#include <fstream>
#include <iostream>
#include <algorithm>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <string>
#include <sstream>
#include <map>
#include <set>
#include <vector>
#include <cmath>
#include <queue>
#include <random>

using namespace std;

#define min(a,b) ((a)<(b) ? (a):(b))
#define max(a,b) ((a)>(b) ? (a):(b))

int gcd(int a, int b){
    while( b ){
        int m = a % b;
        a = b;
        b = m;
    }
    return a;
}

int lcm(int a, int  b){
    return (a*b)/gcd(a,b);
}

int isPrim(int a){
    if(a==1){
        return 0;
    }
    for(int i=2;i<=(a+1)/2;i++){
        if(a%i==0){
            return 0;
        }
    }
    return 1;
}

long long mod_pow(long long x, long long n, long long mod){
    //x???n???????¨????????????????n??????2?????¨?¨???????????¨????
    //x^22 = x^16 + x^4 + x^2
    long long ret=1;
    while(n>0){
        if(n%2==1){
            ret=(ret*x)%mod;//???????????????
        }
        x=(x*x)%mod;//2???
        n=n/2;
    }
    return ret;
}

struct VV{
    int x;
    int y;
    int z;
};

class LessInt {
public:
    bool operator()(const VV& riLeft, const VV& riRight) const {
        if(riLeft.x == riRight.x){
            return riLeft.y > riRight.y;
        }
        return riLeft.x > riRight.x;
        
    }
};

class indInt {
public:
    bool operator()(const VV& riLeft, const VV& riRight) const {
        return riLeft.x < riRight.x;
        
    }
};

struct XX{
    long long min=0;
    long long kake=0;
};

class xxIntu {
public:
    bool operator()(const XX& riLeft, const XX& riRight) const {
        //?¬¬1?????¶
        if(riLeft.kake != riRight.kake){
            return riLeft.kake > riRight.kake;//<:??????(?°??????????)???>:??????(??§?????????)
        }
        //?¬¬2?????¶
        return riLeft.min > riRight.min;
    }
};
bool operator< (const VV &riLeft, const VV &riRight){
    return riLeft.z < riRight.z;
};
/*bool operator> (const XX &riLeft, const XX &riRight){
    return riLeft.a > riRight.a;
};*/

int funC(int a,int b){
    int tmp=1;
    int tmp2=1;
    for(int i=0;i<b;i++){
        tmp=tmp*(a-i);
        tmp2=tmp2*(b-i);
    }
    return tmp/tmp2;
}

int main(int argc, const char * argv[])
{
    //std::ios::sync_with_stdio(false);
    //scanf("%s",S);
    //scanf("%d",&N);
    //getline(cin, target);
    //cin >> x >> y;
    //???????????¨
    //ifstream ifs( "1_06.txt" );
    //ifs >> a;
    //????????????

    int N,M,A,B;
    cin >> N >> M >> A >> B;
    int D[1000];
    for(int i=0;i<N;i++){
        cin >> D[i];
    }
    int haki[1000];
    for(int i=0;i<N;i++){
        haki[i]=0;
    }
    int sum=0;
    for(int i=0;i<N;i++){
        if(D[i]>=A){
            haki[i]=1;
            sum++;
        }else{
            break;
        }
    }
    if((N-sum)<M){
        for(int i=N-1;i>=0;i--){
            if(D[i]<=B && haki[i]==1){
                haki[i]=0;
            }else if(haki[i]==1){
                break;
            }
        }
    }
    sum=0;
    for(int i=0;i<N;i++){
        sum=sum+haki[i];
    }
    cout << sum << endl;
    
    //???????????§
    //cout << "ans" << endl;????????????
    //printf("%.0f\n",ans);//?°???°?????\?????¨?????????
    //printf("%.7f\n",p);
    //printf("%f\n",pow(2,ans.size()));
    
    return 0;
}

Measured memory_bytes: 3096