#c221401. 区间取数1
区间取数1
Range Selection 1
Problem Description
You are given numbers and an integer . You need to choose consecutive numbers from these numbers such that the maximum among the numbers does not exceed . How many ways are there to do this?
Input Format
The first line contains three integers .
The next line contains integers .
Output Format
Output one line containing a number: the answer.
Sample Input 1
3 2 2
3 2 1
Sample Output 1
1
Sample Input 2
10 2 3
2 0 0 7 1 2 2 1 5 1
Sample Output 2
3
Constraints
For of the data, .