Dancing school#397

Dancing school

1 second
128 megabytes
Easy (≈1000)

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?

Input

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).

Output

Print a single integer — the number of ways to choose a group in which the number of boys and girls is equal.

Examples

Example 1

Loading
Loading