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

let ans = [for i in 0..(n - k - 1) -> h.[i]] |> List.map int64 |> List.sum

ans
|>stdout.WriteLine