Consecutive
Easy
Execution time limit is 1 second
Runtime memory usage limit is 128 megabytes
You are given a string of length consisting of lowercase English letters.
Additionally, you are given queries about the string . For , the -th query is represented by two integers and asks the following:
In the substring of , which ranges from the -th to the -th character, how many places are there where the same lowercase English letter occurs twice in a row? In other words, how many integers satisfy and ?
Print the answer for each of the queries.
Input
The first line contains two integers and .
The second line is a string of length consisting of lowercase English letters.
Each of the next lines contains a query .
Output
Print lines. For , the -th line should contain the answer to the -th query.
Examples
Input #1
Answer #1
Input #2
Answer #2
Submissions 69
Acceptance rate 38%