You are given a string consisting only of 0 and 1.
You may perform the following operation any number of times.
Choose two equal adjacent characters and delete both of them simultaneously. After the deletion, the remaining parts are joined together.
A string is called a vanishing string if it can become the empty string using only this operation.
For every integer pair with , consider the substring . Count how many of these substrings are vanishing strings.
The input is given from Standard Input in the following format:
For each test case, print the number of vanishing substrings on one line.
Each case is given in the following format:
0 and 1.| 3 | 55 | No additional constraints. |