#include <iostream>
using namespace std;

int main(){
  int N,M,A,B;
  int koho = 0;
  int d[1000] = {};
  int haiki[1000] = {};

  cin >> N >> M >> A >> B ;

  for(int i = 0; i < N ;i++){
    cin >> d[i];
  }

  for(int i = 0;i < N;i++){
    if(d[i] >= A){
      koho++;
      haiki[koho] = d[i];
    }else{
      break;
    }
  }
  if(N - koho < M){
    for(int i = koho;i > 0;i--){
      if(haiki[i] <= B){
        koho--;
      }else{
        break;
      }
    }
    }
      cout << koho << endl;



}