function main(input) {
  const arg = input.split('\n'), t = arg[0].split(' ')
  var n = t[0], k = t[1]
  var a = arg[1].split(' ').map(x => parseInt(x, 10))
  a.sort()
  var s = 0
  for(var i=0;i<(n-k);i++) s += a[i]
  console.log(s)
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));
