function Main (input) {
  input = input.split("\n");
  var ts = input[0].split(" ");
  const N = parseInt(ts[0], 10);
  const K = parseInt(ts[1], 10);
  const H = input[1].split(" ").map(inp => parseInt(inp, 10)).sort((a, b) => b > a);
  for (var i_1 = 0; i_1 < K; i_1++) {
    H.shift();
  }
  var ans = 0;
  for (var i_2 of H) {
    ans += i_2;
  }
  console.log(ans);
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));