extension String:CollectionType{}
func readInts()->[Int]{
  return readLine()!.split(" ").map{Int($0)!}
}
var a:[Int]=readInts()
var n=a[0]
var k=a[1]
var h:[Int]=readInts()
var sh=h.sort{$0<$1}
var sum:Int64=0
if(n<=k){print(0)}
else{
  for i in 0..<n-k{
  sum=sum+sh[i]
}
print(sum)
}

