RMN wasted all his money on sports betting... again. However, he still feels the need of betting just one more time in order to at least recover his losses.
The only issue is that he needs a big sum to get a good return on his last "safe" bet. Because he doesn't have a lot of skills, he can't get this money too easily. Luckily, a man in the parking spot of a gas station offered him 100 RON if he can count how many substrings of an integer sequence have their maximum value between two given values.
More formally, RMN receives an integer sequence of numbers, and two integers and . He is asked to count how many substrings have .
Help RMN retire in glory by winning the 100 RON needed for his first win!
P.S. He will probably lose anyway :(
Input data
The first line will contain 3 integers (), (), () - the length of the array , the lower and the upper bounds for the maximum of the substrings that need to be counted.
The following line will contain integers between and - the values of the sequence .
Output data
The only line will contain a single integer - the number of substrings of with their maximum value between and .
Constraints and clarifications
- For points, it is guaranteed that ;
- For another points, it is guaranteed that ;
- For the last points, we have .
Example
stdin
5 3 4
1 5 2 4 3
stdout
5
Explanation
The substrings with their maximum value between 3 and 4 are: