a = gets.chomp.split().map(&:to_i)
a.sort!.reverse!

border = a[P-1]
preborder_count = a.select{|e| e>border}.count

ans = 0
bsum = 0
bcount = 0
n.times do |i|
  if a[i] > border
    ans+=1
  elsif a[i] == border
    bsum += a[i]
    bcount += 1
    ans+=1
  else
    if a[i] + m >= border # チャンスあり
      #if n - i + P-1 >= v
      # p [bcount*(a[i]+m), bsum, m*(v-(n - i - 1 + preborder_count))]
      if bcount*(a[i]+m) - bsum >= m*(v-(n - i + preborder_count))
        ans += 1
      end
    end
    bsum += a[i]
    bcount += 1
  end
end

puts ans