open System
let R T = stdin.ReadLine()|> T
let RS T = stdin.ReadLine().Split()|>Array.map T
let Mod = (1e9|>int64)+7L
[<EntryPoint>]
let main argv =
    let N,K = RS int|>fun c -> c.[0],c.[1]
    RS int64
    |>Array.sort
    |>fun c -> c.[0..N-K-1]
    |>Array.sum
    |>stdout.WriteLine
    0