function main(input) {
  const arg = input.split('\n'), t = arg[0].split(' ')
  var n = parseInt(t[0], 10), k = parseInt(t[1], 10)
  k = Math.min(n, k)
  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'));
