"use strict";

function Main(input) {
  let lines = input.trim().split("\n");
  let monstarInfo = lines[0].split(" ").map(x => x - 0);
  let monstarNum = monstarInfo[0];
  let hissatsuNum = monstarInfo[1];
  let feneInfo = lines[1].split(" ").map(x => x - 0).sort((a,b) => {return (a < b ? 1 : -1)});
  let sum = 0;
  feneInfo = feneInfo.splice(hissatsuNum);
  sum = feneInfo.reduce((sum, x) => sum + x );
  console.log(sum);
}

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