import CoreFoundation

let arr = readLine()!.characters.split{$0==" "}.map{Int(String($0))!}
let n = arr[0]
let k = arr[1]

var h = readLine()!.characters.split{$0==" "}.map{Int(String($0))!}
h = h.sort()
let hNum = h.count

var i: Int = 0
var ret: Int = 0

if( k >= h.count ) {
  print(0)
  exit(0)
}

for i in k..<hNum {
  ret += h[i]
}
print(ret)