{$ifdef fpc} {$mode delphi} {$endif}
{$apptype console}
{$s-,i-,r-,q-,v-,d-,l-,o+}
const
	filein = 'A.in';
	fileout = 'A.out';
	maxn = 1001000;
var
	a: array[0..maxn]of longint;
	n,m,i: longint; ans: int64;

procedure sort(l,r: longint);
var
	i,j,x: longint;
begin
	if not (l < r) then exit;
   i := random(r - l + 1) + l; a[0] := a[i]; a[i] := a[l]; a[l] := a[0];
	i := l - 1; j := r + 1; x := a[l];
	while i < j do begin
		repeat inc(i) until a[i] >= x;
		repeat dec(j) until a[j] <= x;
		if i < j then begin
			a[0] := a[i]; a[i] := a[j]; a[j] := a[0];
		end;
	end;
	sort(l,j); sort(j + 1,r);
end;

begin
	assign(input,filein);reset(input);assign(output,fileout);rewrite(output);
	read(n,m); for i := 1 to n do read(a[i]);

	randomize; sort(1,n); ans := 0;
	for i := m + 1 to n do ans := ans + a[i];

	writeln(ans);
	close(output);
end.