var
  i,j,k,l,m,n           : longint;
  s                     : real;
  a                     : array [1..1000000] of longint;

procedure sort(l,r:longint);
var
  i,j,x,y:longint;
begin
  x:=a[(l+r)div 2];
  i:=l;j:=r;
    while a[i] < x do inc(i);
    while a[j] > x do dec(j);
     if i<=j then begin
       y:=a[i];
       a[i]:=a[j];
       a[j]:=y;
       inc(i);dec(j);
     end;
  if (i<r) then sort(i,r);
  if (l>j) then sort(j,l);
end;

begin
  assign(input,'a.in');
  assign(output,'a.out');
  reset(input);rewrite(output);
   read(n,k);
   for i:=1 to n do read(a[i]);
   sort(1,n);
   for i:=k+1 to n do s:=s+a[i];
   writeln(s:0:0);
  close(input);close(output);
end.
