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