/*  -*- coding: utf-8 -*-
 *
 * 2791.cc: Cabbage
 */

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<set>
#include<stack>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<numeric>
#include<utility>
#include<complex>
#include<functional>
 
using namespace std;

/* constant */

const int MAX_N = 1000;

/* typedef */

/* global variables */

int ds[MAX_N];

/* subroutines */

/* main */

int main() {
  int n, m, a, b;
  scanf("%d%d%d%d", &n, &m, &a, &b);

  for (int i = 0; i < n; i++) scanf("%d", ds + i);

  int rn = 0;
  while (rn < n && ds[rn] >= a) rn++;
  //printf("rn=%d\n", rn);
  if (n - rn < m)
    while (rn > 0 && ds[rn - 1] <= b) rn--;
  printf("%d\n", rn);
  return 0;
}

