// 🐋💭
import Foundation

func readInts() -> [Int] {
    return readLine()!.split(separator: " ").map { Int($0)! }
}



func main() {
    let nk = readInts()
    let (n, k) = (nk[0], nk[1])
    var aryA = readInts()
    //__________________________ここまで入力
    aryA.sort()
    
    if k <= n {
        aryA.removeLast(k)
    } else {
        aryA.removeAll()
    }
    
    print(aryA.reduce(0) { $0 + $1 })
}

main()



