"use strict";

// 外部からもらってきた関数
function asc(a,b){
	return (b - a);
}

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(asc);
  let sum = 0;
  feneInfo = feneInfo.splice(hissatsuNum);
  if(feneInfo.length > 0){
  	sum = feneInfo.reduce((sum, x) => sum + x );
  }
  console.log(sum);
}

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