#include <bits/stdc++.h>
using namespace std;
int dp[10000][2001];
int main()
{
int n, k, x, y;
cin >> n >> k >> x >> y;
vector<int> a(n + 1);
for(int i = 1; i <= n; i++){
cin >> a[i];
}
sort(a.begin() + 1, a.end());
for(int himars = 0; himars <= k; himars++){
dp[0][himars] = himars;
}
for(int cnt = 1; cnt <= n; cnt++){
int left_x = lower_bound(a.begin() + 1, a.end(), a[cnt] - x) - a.begin();
int left_y = lower_bound(a.begin() + 1, a.end(), a[cnt] - y) - a.begin();
for(int himars = 0; himars <= k; himars++){
dp[cnt][himars] = dp[left_x - 1][himars] + 1;
if(himars > 0){
dp[cnt][himars] = min(dp[cnt][himars], dp[left_y - 1][himars - 1] + 1);
}
}
}
int ans = dp[n][0];
for(int himars = 0; himars <= k; himars++){
ans = min(ans, dp[n][himars]);
}
cout << ans << endl;
return 0;
}