"use strict"
function Main(input) {
  input = input.split('\n');
  let i1 = input[0].trim().split(' ').map(Number);
  let n = i1[0];
  let k = i1[1];

  let mons = input[1].trim().split(' ').map(Number);
  mons.sort((a,b) => a>b? 1:-1);

  let atk = 0;
  for(let i=0; i<n-k; ++i){
    atk+=mons[i];
  }
  console.log(atk);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));