function Main(inputs) {
  var lines = inputs.split('\n')

  var N = +(lines[0].split(' ')[0])
  var K = +(lines[0].split(' ')[1])

  var HitPoints = lines[1]
    .split(' ')
    .map(v=>+v).sort((a,b)=> a>b ? 1 : -1)

  var size = Math.max(N - K,0)
  var max = 0
  for (var i = 0;i<size;i++){
    max += HitPoints[i]
  }
  console.log(max)
  //console.log(HitPoints.slice(0,size).reduce((s,v)=>s+v,0))
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
