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

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