let [|n; k|] = stdin.ReadLine().Split() |> Array.map int
let a = stdin.ReadLine().Split()
if n <= k then printfn "0"
else a |> Array.map int64 |> Array.sortDescending |> Array.skip k |> Array.sum |> printfn "%d"