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

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