Professor Arkan's ballroom dance school has enrolled students—boys and girls. The professor lines them up in a single row and wants to select a group of consecutive students for the first lesson such that the number of boys and girls in the group is equal. How many ways can the professor choose such a group?
The first line contains an integer (1 \leq n \leq 10^6). The second line contains a string of characters, each either (representing a girl) or (representing a boy).
Print a single integer—the number of ways to choose a group in which the number of boys and girls is equal.
Example 1