Statement
Statement language
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.
Input
The input is given from Standard Input in the following format:
Each case is given in the following format:
Output
For each test case, print the number of vanishing substrings on one line.
Constraints
- .
- .
- The length of is .
- consists only of
0and1. - The sum of over all test cases does not exceed .
Subtasks
Samples
Input
1
7
0011001
Output
8