var  a:array [1..1000010] of longint; 
     i,j,k,l,n,m:longint;
     ans:int64;
procedure qs(l,r:longint);
var i,j,k,c:longint;
begin
    i:=l; j:=r; k:=a[(l+r) div 2];
     repeat
      while (a[i]<k) do inc(i);
      while (a[j]>k) do dec(j);
       if (i<=j) then
        begin
          c:=a[i]; a[i]:=a[j]; a[j]:=c;
           inc(i); dec(j);
        end;
     until i>j;
    if (i<r) then qs(i,r);
    if (l<j) then qs(l,j);
end;
begin
  assign(input,'A.in');   reset(input);
  assign(output,'A.out'); rewrite(output);
   read(n,k); ans:=0;
    for i:=1 to n do
     read(a[i]);
    qs(1,n);
     for i:=1+k to n do
      ans:=ans+a[i];
     writeln(ans);
  close(output);
end.