var a: array of integer;
   i,j,n,k,buf:longint;
   res:extended;

begin
   assign(input,'A.in');
   reset(input);
   assign(output,'A.out');
   rewrite(output);

   read(n,k);
   setlength(a,n-k+1);
   for i:=1 to n-k do read(a[i]);
   for i:=1 to n-k do
      for j:=1 to n-k-1 do
         if a[j+1]<a[j] then begin
            buf:=a[j];
            a[j]:=a[j+1];
            a[j+1]:=buf;
         end;

   for i:=n-k+1 to n do begin
        read(buf);
        if buf>a[1] then begin

           a[1]:=buf;
           for j:=1 to n-k-1 do begin
              buf:=a[j];
              a[j]:=a[j+1];
              a[j+1]:=buf;
           end;
        end;
   end;
   res:=0;
   for i:=1 to n-k do res:=res+a[i];

   write(res:0:0);

   close(output);
end.
