#include<bits/stdc++.h>
using namespace std;

int n, p, ans;
long long sum[100005], top, d, m, v, a[100005];

bool cmp(int a, int b) { return a > b; }

int main() {
	cin>>n>>m>>v>>p;
	v = n - v;
	top = v*m;
	for(int i = 1; i <= n; i++)
		scanf("%lld", &a[i]);
	sort(a + 1, a + n + 1, cmp);
	for(int i = 1; i <= n; i++)
	    sum[i] = sum[i - 1] + a[i];
	ans = p;
	for(int i = p + 1; i <= n; i++) {
		d =  sum[i - 1] - sum[p - 1] - a[i]*(long long)(i - p);
		if(d > top) continue;
		if(a[p] - a[i] > m) continue;
		ans++;
	}
	cout<<ans<<endl;
} 


#include <vector>
#include <iostream>
#include <algorithm>

#pragma warning(disable : 4996)

using namespace std;

int n, bit[262145];

vector<int> a, b;

void add(int i, int x)
{
	while (i <= n)
	{
		bit[i] += x; i += i & -i;
	}
}

int sum(int i)
{
	int ret = 0;

	while (i > 0)
	{
		ret += bit[i]; i -= i & -i;
	}
	
	return ret;
}

int sum(int l, int r)
{
	return sum(r - 1) - sum(l - 1);
}

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

	a.resize(n);

	for (int i = 0; i < n; i++) scanf("%d", &a[i]);

	b = a; sort(b.begin(), b.end());

	long long ret = 0;

	for (int i = 0; i < n; i++)
	{
		int ptr = lower_bound(b.begin(), b.end(), a[i]) - b.begin(); add(ptr + 1, 1);

		ret += sum(ptr + 2, n + 1);
	}

	printf("%lld\n", ret);

	return 0;
}