var
A : array[1..1000000] of integer;
n,k,i,j,max,Sum:longint;
f:text;
begin
assign(f,'A.in');
reset(f);
readln(f,n,k);
sum:=0;
for i:=1 to n do read(f,a[i]);
close(f);
for i:=1 to n-1 do
for j:=i+1 to n do
begin
if (a[i]<a[j]) then
begin
max:=a[i];
a[i]:=a[j];
a[j]:=max;
end;
end;
for i:=1 to n-k do
begin
Sum:= a[i]+Sum;
end;
assign(f,'a.out');
rewrite(f);
writeln(f,sum);
close(f);
 { TODO -oUser -cConsole Main : Insert code here }

end.
