let[|n;k|] = stdin.ReadLine().Split() |> Array.map int

if n<=k then stdout.WriteLine 0
else
    stdin.ReadLine().Split()
    |> Array.map int64
    |> Array.sort
    |> fun x -> x.[0..(n-k-1)]
    |> Array.sum
    |> stdout.WriteLine