Vasile has a mustache of gigantic proportions and wishes to trim it. His mustache can be seen as a vector, , of elements, where = the length of the th hair, . We define the ugliness degree of an interval as the difference between the longest and the shortest hair in the interval .
Task
Determine how many intervals exist such that the ugliness degree is between and .
Input data
The first line contains the natural number , as described above.
The second line contains the natural numbers and , as described above.
The third line contains natural numbers, representing the vector .
Output data
The first line will contain a single integer, representing the number of intervals such that the ugliness degree is between and .
Constraints and clarifications
- For of the tests:
- For of the tests:
- Recall that is indexed from
- It is recommended to use fast I/O
Example 1
stdin
6
4 5
1 7 5 4 2 6
stdout
5
Explanation
Example 2
stdin
5
0 0
1000000000 1000000000 1000000000 1000000000 1000000000
stdout
15
Explanation
All intervals have an ugliness degree of .