import java.io.*;
import java.util.*;

public class Main
{
   public static void main(String[] args) throws IOException {
     Scanner in = new Scanner(new FileReader("A.in"));
     PrintWriter out = new PrintWriter(new FileWriter("A.out"),true);
int n=in.nextInt();
int k=in.nextInt();
int a[]=new int[n];
for(int i=0;i<n;i++) a[i]=in.nextInt();
Arrays.sort(a);
long sum=0;
for(int i=n-1;i>=k;i--) sum+=a[i];
out.println(sum); 
     }
}