type
  list = array[1..1000001] of longint;

var
  a: list;
  n,k,i,s: longint;

{ QUICKSORT sorts elements in the array A with indices between  }
{ LO and HI (both inclusive). Note that the QUICKSORT proce-    }
{ dure provides only an "interface" to the program. The actual  }
{ processing takes place in the SORT procedure, which executes  }
{ itself recursively.                                           }

procedure quicksort(var a: list; Lo,Hi: integer);

procedure sort(l,r: integer);
var
  i,j,x,y: integer;
begin
  i:=l; j:=r; x:=a[(l+r) DIV 2];
  repeat
    while a[i]<x do i:=i+1;
    while x<a[j] do j:=j-1;
    if i<=j then
    begin
      y:=a[i]; a[i]:=a[j]; a[j]:=y;
      i:=i+1; j:=j-1;
    end;
  until i>j;
  if l<j then sort(l,j);
  if i<r then sort(i,r);
end;

begin {quicksort};
  sort(Lo,Hi);
end;

begin {qsort}
  assign(input,'A.in');
  reset(input);
  assign(output,'A.out');
  rewrite(output);
  readln(n,k);
  for i:=1 to n do read(a[i]);
  quicksort(a,1,n);

  for i:=k+1 to n do
  begin
      s:=s+a[i];
  end;
  writeln(s);
  close(output);
  close(input);
end.
