let input = readLine()!.split(separator: " ").map { Int($0)! }
let N = input[0]
let K = input[1]
let H = readLine()!.split(separator: " ").map { Int($0)! }.sorted()

var sum = 0
var i = 0
while i < H.count - K {
  sum += H[i]
  i += 1
}
print(sum)
