A total of students — boys and girls — enrolled in Professor Padegras' ballroom dance school. The professor lined them up in a single row and wants to select a group of consecutive students for the first lesson, in which the number of boys and girls is equal. How many different ways can the professor choose such a group?
The first line contains an integer n~(1 \le n \le 10^6) — the number of students. The second line contains a sequence of characters, where each character is 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