N, M, V, P = gets.chomp.split(" ").map{|s| s.to_i }
arr = gets.chomp.split(" ").map{|s| s.to_i }

h = {}
arr.each do |i|
  h[i] ||= 0
  h[i] += 1
end

count = 0
diff = N - V
if diff == 0
  h.sort_by{|k, v| -k}.each do |k, v|
    count += v
    if count >= P
      break
    end
  end
else
  line_num = 0
  before = 0
  h.sort_by{|k, v| -k}.each do |k, v|
    if 0 < line_num && line_num > k + M
      break
    end
    count += v
    if count >= P && line_num == 0
      line_num = k + (diff < v ? 1 : 0)
    elsif count > P + diff
      break
    end
    before = k
  end  
end

puts count