program Project1;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var
  n,k,t1,t2,t3: integer;
  sum: int64;
  a: array of integer;
  F: textfile;

begin
  AssignFile(F,'A.in');
  Reset(F);
  Readln(F,n,k);
  setlength(a,n+1);
  for t1:=1 to n do
  begin
    read(F,a[t1]);
  end;
  CloseFile(F);
  for t1:=1 to n-k do
    for t2:=t1+1 to n do
    begin
      if a[t1]<a[t2] then
      begin
        t3:=a[t2];
        a[t2]:=a[t1];
        a[t1]:=t3;
      end;
    end;

  sum:=0;
  for t1:=1 to n-k do
    sum:=sum+a[t1];

  AssignFile(F,'A.out');
  rewrite(F);
  writeln(F,sum);
  closefile(F);
end.
 