n, k, x, y = map(int, input().split())
a = list(map(int, input().split()))
a.sort()
a = [0] + a
dp = [[]]
for himars in range(0, k + 1):
dp[0].append(himars)
left_x = 1
left_y = 1
for cnt in range(1, n + 1):
while a[left_x] < a[cnt] - x:
left_x += 1
while a[left_y] < a[cnt] - y:
left_y += 1
dp_cnt = []
for himars in range(k + 1):
cur_dp = dp[left_x - 1][himars] + 1
if himars > 0:
cur_dp = min(cur_dp, dp[left_y - 1][himars - 1] + 1)
dp_cnt.append(cur_dp)
dp.append(dp_cnt)
print(min(dp[n]))