A: Cabbage
Problem Statement
AOR Ika-chan has obtained a cabbage with $N$ leaves. The leaves of this cabbage are numbered from 1 to $N$ in order from the outside, and the degree of dirtiness of the $i$-th leaf is $D_i$. The larger the value, the dirtier the leaf.
AOR Ika-chan decided to select dirty leaves to be discarded according to the following procedure for using the leaves of this cabbage for cooking.
- Initialize the discard candidate to empty.
- Focus on the outermost leaf that hasn't been checked yet. If all are finished, finish.
- If the degree of dirtiness of the leaf is equal to or greater than $A$, add it to the discard candidate and return to 2. Otherwise, finish.
However, it was found that the number of leaves that could be used for cooking became extremely small as a result of this operation. Therefore, AOR Ika-chan decided to reconsider the leaves to be discarded after the above operation and to perform the following operation.
- If the number of leaves that are not discard candidates is less than $M$, proceed to 2. Otherwise, finish.
- Focus on the innermost leaf among the discard candidate leaves that has not yet been checked. If there are no discard candidate leaves, finish.
- If the degree of dirtiness of the leaf is less than or equal to $B$, remove it from the discard candidate and return to 2. Otherwise, discard all the discard candidate leaves and finish.
Find the number of leaves to be finally discarded.
Input
$N \ M \ A \ B$
$D_{1} \ D_{2} \ \cdots \ D_{N}$
Constraints
$1 \leq N \leq 1000$
$0 \leq M \leq N$
$1 \leq A \leq B \leq 1000$
$1 \leq D_{i} \leq 1000$
Output
Output the number of leaves to be finally discarded.
Sample Input 1
5 3 6 9
9 7 5 3 1
Sample Output 1
2
Discard the first and second leaves.
Sample Input 2
5 3 6 9
5 4 3 2 1
Sample Output 2
0
Do not discard any leaves from the first leaf.
Sample Input 3
5 3 6 9
10 8 6 4 2
Sample Output 3
1
Although he tried to discard the first three leaves, he changed his mind and decided not to discard the second and third leaves.
Sample Input 4
5 3 6 9
5 10 8 6 4
Sample Output 4
0
AOR Ika-chan doesn't know that the second leaf is dirty.
Sample Input 5
5 0 6 9
9 9 8 8 7
Sample Output 5
5
Do not mind discarding all of them.