#include <bits/stdc++.h>
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,b) FOR(i,0,b)
#define PB push_back


using namespace std;
int N,M,A,B;
deque<int> deq;
int x,order;
int main(){
	cin >> N >> M >> A >> B;
	REP(i,N){
		cin >> x;
		deq.PB(x);
	}
	int orderA=-1;
	REP(i,N+1){
		if(i==N || deq[i]<A){
			order=i-1;
			break;
		}
	}
	if(N-(order+1)<M) 
		REP(i,N){
			if(deq[N-i-1]<=B){
				order=min(order,N-i-2);
			}
			else{
				break;
			}
		}
	cout << order+1 << endl;
}