#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast")
#pragma GCC optimize ("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define mod 1000000007
#define pb emplace_back
#define mp make_pair
#define fi first
#define sec second
typedef long long ll;
typedef long double  ld;
#define pii pair<ll,ll> 
#define vi vector< ll > 
#define vvi vector< vi > 
#define vpi vector< pii > 
#define vvpi vector< vpi > 
#define fast ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define test(t) ll t;cin>>t;while(t--)
#define mem(a,b) memset(a,b,sizeof(a))
#define inn freopen("input.txt", "r", stdin)
#define outt freopen("output.txt", "w", stdout)
#define all(arr) arr.begin(),arr.end()
#define fr(i,n) for(ll i=0;i<(n);++i)
#define rep(i,a,b) for(ll i=a;i<=b;++i)
#define per(i,a,b) for(ll i=a;i>=b;i--)
#define remin(a,b) (a=min((a),(b)))
#define remax(a,b) (a=max((a),(b)))
#ifndef ONLINE_JUDGE
#define debarr(a,n)cerr<<#a<<":";for(int i=0;i<n;i++)cerr<<a[i]<<" ";cerr<<endl;
#define debmat(mat,row,col)cerr<<#mat<<":\n";for(int i=0;i<row;i++){for(int j=0;j<col;j++)cerr<<mat[i][j]<<" ";cerr<<endl;}
#define pr(...)dbs(#__VA_ARGS__,__VA_ARGS__)
template<class S,class T>ostream &operator<<(ostream &os,const pair<S,T> &p){return os<<"("<<p.first<<","<<p.second<<")";}
template<class T>ostream &operator<<(ostream &os,const vector<T> &p){os<<"[";for(auto&it:p)os<<it<<" ";return os<<"]";}
template<class T>ostream &operator<<(ostream &os,const set<T>&p){os<<"[";for(auto&it:p)os<<it<<" ";return os<<"]";}
template<class T>ostream &operator<<(ostream &os,const multiset<T>&p){os<<"[";for(auto&it:p)os<<it<<" ";return os<<"]";}
template<class S,class T>ostream &operator<<(ostream &os,const map<S,T>&p){os<<"[";for(auto&it:p)os<<it<<" ";return os<<"]";}
template<class T>void dbs(string str,T t){cerr<<str<<":"<<t<<"\n";}
template<class T,class...S>void dbs(string str,T t,S... s){int idx=str.find(',');cerr<<str.substr(0,idx)<<":"<<t<<",";dbs(str.substr(idx+1),s...);}
#else
#define pr(...){}
#define debarr(a,n){}
#define debmat(mat,row,col){}
#endif
ll power(ll x,ll y){ll res = 1;while(y){if(y&1) res = (res*x)%mod;y=y/2,x=(x*x)%mod;}return res%mod;}
ll arr[100001];
ll n,m,v,p;
ll prefix[100001];
ll func(ll x)
{
    ll low = 0;
    ll high = n-1;
    ll ans = -1;
    while(low<=high)
    {
        ll mid = (low+high)/2;
        if(arr[mid]>x)
            ans = mid,low = mid+1;
        else
            high = mid-1;
    }
    return ans+1;
}
signed main()
{
    fast;
    cin>>n>>m>>v>>p;
    ll i;
    for(i=0;i<n;i++){
        cin>>arr[i];
    }
    sort(arr,arr+n);
    reverse(arr,arr+n);
    for(i=0;i<n;i++)
    {
        if(i)
            prefix[i] = prefix[i-1]+arr[i];
        else
            prefix[i] = arr[i];
    }
    ll cnt = 0;
    for(i=0;i<n;i++)
    {
        if(i<p)
        {
            cnt++;
            continue;
        }
        ll temp = func(m+arr[i]);
        // pr(temp,i,p,arr[i]);
            ll current_rank = p-temp;
            if(current_rank<=0)
                continue;
            ll x = n-i+min(i,p-1);
            if(x>=v){
                // pr(i);
                cnt++;
            }
            else{
            ll xx = prefix[i-1];
            ll y = i-1;
            if(min(i,p-1))
                xx-=prefix[min(i,p-1)-1],y-=(min(i,p-1)-1);
            else
                y++;
            // pr(min(i,p-1)-1);

            // ll y = i-min(i,p-1)-1;
            // pr(xx,y);
            if(xx+(v-x)*m<=(m+arr[i])*y){
                // pr(i);
                cnt++;}
            }
    }
    cout<<cnt;
    
}


Measured memory_bytes: 1792