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 is a successful string when there is a position such that . Here denotes the -th character of .
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 that represents the length of a string.
The second line contains a string of length consisting of lowercase alphabets.
출력
Output the number of successful strings among the substrings of the given string.