Successful String

아직 제출이 없습니다시간 제한1초메모리 제한1024 MB

문제

Yunee is studying English vocabulary. Among many words that Yunee has learned, "success" is Yunee's favorite word and "failure" is Yunee's least favorite word.

Yunee noticed that two identical characters appear in a row in the word "success" but not in the word "failure." So Yunee decided to call a string "successful string" when it has a property of the word "success." Formally, a string SS is a successful string when there is a position ii such that S_i=S_i+1S\_i = S\_{i+1}. Here S_iS\_i denotes the ii-th character of SS.

Yunee wants to count how many successful strings there are among the substrings of a given string. Help Yunee write a program that counts the number of successful substrings. You have to consider two substrings distinct when their positions are different, even if the two strings are the same.

입력

The first line contains an integer NN that represents the length of a string. (1N106)(1 \leq N \leq 10^6)

The second line contains a string of length NN consisting of lowercase alphabets.

출력

Output the number of successful strings among the substrings of the given string.