A string of digits is called -decodable if there is exactly one way to split it into non-empty contiguous parts such that each part is the decimal representation of an integer between and , inclusive. Leading zeros are not allowed, so a part may not start with the digit .
For example, the string is -decodable: the only valid split is . It is not -decodable, because both and are valid.
You are given a string of length consisting of digits, and queries. Each query consists of two integers and . For each query, count the contiguous substrings of that are -decodable.
Input
The first line contains two integers and (, ), the length of the string and the number of queries.
The second line contains the string of length , consisting of digits --.
Each of the next lines contains two integers and (, ), describing a query.
Output
For each query, print a single integer: the number of contiguous substrings of that are -decodable.
Example
stdin
6 2
102130
5 0
2 1
stdout
7
8
Note
In the first query, , so every part must be one of . Since no part can contain a , a substring that contains a has no valid split at all. The substrings that are -decodable are:
- , split as ;
- , split as ;
- , split as ;
- , split as ;
- , split as ;
- , split as ;
- , split as .
In the second query, the substrings that are -decodable are , , , , , , and .