#include <stdio.h>
#include <stack>

int main(void){
  int n, m, a, b, i, j;
  scanf("%d%d%d%d", &n, &m, &a, &b);
  int d[n];
  std::stack<int> s;
  for(i = 0; i < n; ++i) {
    scanf("%d", &d[i]);
    if(d[i] >= a) s.push(d[i]);
    else break;
  }
  if(n - s.size() < m) while(s.size()) {
    int p = s.top();
    if(p <= b) {
      s.pop();
    } else break;
  }
  printf("%d\n", s.size());
  return 0;
}
