#pragma GCC optimize(2)
#include <bits/stdc++.h>
#define int long long
using namespace std;

int n,m,v,p,a[100010];
vector<int> res;

inline bool check(int x)
{
	int val=n-x+1;
	int cnt=max(0ll,v-val);
	if(cnt<p) return a[x]+m>=a[p];
	if(a[x]+m<a[p]) return false;
	cnt-=p-1;
	int sum=0ll;
	for(int i=p;i<x;i++) sum+=(a[x]+m-a[i]);
	if(sum<m*cnt) return false;
	return true;
}

signed main()
{
	ios::sync_with_stdio(false);
	cin>>n>>m>>v>>p;
	for(int i=1;i<=n;i++) cin>>a[i];
	sort(a+1,a+n+1);
	reverse(a+1,a+n+1);
	int l=p+1,r=n,ans=p;
	while(l<=r){
		int mid=(l+r)/2;
		if(check(mid)){
			ans=mid;
			l=mid+1;
		}
		else r=mid-1;
	}
	cout<<ans<<endl;
	return 0;
}