#include<bits/stdc++.h>
#define r(i,n) for(int i=0;i<n;i++)
using namespace std;
int main(){
  int n,m,a,b,t;
  cin>>n>>m>>a>>b;
  vector<int>d;
  r(i,n){
    cin>>t;
    if(t<a)break;
    else d.push_back(t);
  }
  if(n-(int)d.size()<m)
    while(d.size()&&d[d.size()-1]<=b)d.erase(d.end()-1);
  cout<<d.size()<<endl;
}