#include <bits/stdc++.h>
#define pb push_back
#define int long long 
using namespace std;

inline int read()
{
	int sum=0,ff=1; char ch=getchar();
	while(!isdigit(ch))
	{
		if(ch=='-') ff=-1;
		ch=getchar();
	}
	while(isdigit(ch))
		sum=sum*10+(ch^48),ch=getchar();
	return sum*ff;
}

const int N=1e5+5;

int n,m,a[N],k,p,b[N];

signed main()
{
	n=read();
	m=read();
	k=read();
	p=read();
	for ( int i=1;i<=n;i++ ) 
		a[i]=read();
	sort(a+1,a+n+1); 
	reverse(a+1,a+n+1);
	for ( int i=1;i<=n;i++ ) b[i]=b[i-1]+a[i];
	int ans=p;
	int i;
	for ( i=p+1;i<=n;i++ )
	{
		if(a[i]+m<a[p]) continue;
		int j=i;
//		while(a[j]==a[i]&&j<=n) j++;
//		j--;
		int sum=(n-i+1)+(p-1); 
		if(sum>=k) ans+=(j-i+1);
		else 
		{
			int alb=b[i-1]-b[p-1];
			int need=(k-((n-i+1)+(p-1)))*m;
			if(((a[i]+m)*(i-p)-alb)>=need) ans+=(j-i+1);
		}
		i=j;
	}
	printf("%lld\n",ans);
	return 0;
}

			
			
		
	
#include <bits/stdc++.h>
#include <vector>
#include <iostream>
#include<algorithm>
#include<string>
#include <map>
#include <queue>
#include <stack>
#include<set>
#include<tuple>

#define DIV 1000000007
#define TE 2e5
using namespace std;
using ll = long long;
using ldb = long double;

int main() {
	int N, M; cin >> N >> M;
	vector<pair<int, bool>> num(10);
	for (int a = 1; a <= 9; a++) {
		int p = 0;
		if (a == 1)p = 2;
		if (a == 7)p = 3;
		if (a == 4)p = 4;
		if (a == 2 || a == 3 || a == 5)p = 5;
		if (a == 6 || a == 9)p = 6;
		if (a == 8)p = 7;
		num[a].first = p;
	}

	for (int i = 0; i < M; i++) {
		int a; cin >> a;
		num[a].second = true;
	}

	vector<int> dp(N + 1, -1000);
	dp[0] = 0;
	int po = 0;
	for (int i = 0; i < N; i++) {
		for (int j = 1; j <= 9; j++) {
			if (num[j].second && i + num[j].first <= N) {
				dp[i + num[j].first] = max(dp[i + num[j].first], dp[i] + 1);
				if (dp[i + num[j].first] > 0) po = max(po, i + num[j].first);
			}
		}
	}

	//cout << "after dp" << endl;
	vector<int> ans;
	while (po != 0) {
		for (int i = 9; i >= 1; i--) {
			if (po - num[i].first >= 0 && num[i].second && dp[po] - 1 == dp[po - num[i].first]) {
				ans.push_back(i);
				po -= num[i].first;
				break;
			}
		}
		//cout << "po=" << po << endl;
	}

	//reverse(ans.begin(), ans.end());
	for (int i = 0; i < ans.size() ; i++) {
		cout << ans[i];
	}
	cout << endl;
}