import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
	    
	    int N = scanner.nextInt();
	    int K = scanner.nextInt();
	    if(K>N) {
	    	System.out.println(0);
	    }else {
	    List<Integer> list = new ArrayList<Integer>();
	    for(int i=0;i< N;i++){
	    	list.add(i,scanner.nextInt());
	    }
	    Collections.sort(list,Collections.reverseOrder());
	     long sum = 0;
	     for(int i = K;i < N; i++) {
	    	 sum = list.get(i) + sum;
	     }
	     System.out.println(sum);
	}
	}
} import java.util.ArrayList; ArrayList java.util import java.util.Collections; Collections java.util import java.util.List; List java.util import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
	    
	    int N = scanner.nextInt();
	    int K = scanner.nextInt();
	    if(K>N) {
	    	System.out.println(0);
	    }else {
	    List<Integer> list = new ArrayList<Integer>();
	    for(int i=0;i< N;i++){
	    	list.add(i,scanner.nextInt());
	    }
	    Collections.sort(list,Collections.reverseOrder());
	     long sum = 0;
	     for(int i = K;i < N; i++) {
	    	 sum = list.get(i) + sum;
	     }
	     System.out.println(sum);
	}
	}
} Main public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
	    
	    int N = scanner.nextInt();
	    int K = scanner.nextInt();
	    if(K>N) {
	    	System.out.println(0);
	    }else {
	    List<Integer> list = new ArrayList<Integer>();
	    for(int i=0;i< N;i++){
	    	list.add(i,scanner.nextInt());
	    }
	    Collections.sort(list,Collections.reverseOrder());
	     long sum = 0;
	     for(int i = K;i < N; i++) {
	    	 sum = list.get(i) + sum;
	     }
	     System.out.println(sum);
	}
	} main {
		Scanner scanner = new Scanner(System.in);
	    
	    int N = scanner.nextInt();
	    int K = scanner.nextInt();
	    if(K>N) {
	    	System.out.println(0);
	    }else {
	    List<Integer> list = new ArrayList<Integer>();
	    for(int i=0;i< N;i++){
	    	list.add(i,scanner.nextInt());
	    }
	    Collections.sort(list,Collections.reverseOrder());
	     long sum = 0;
	     for(int i = K;i < N; i++) {
	    	 sum = list.get(i) + sum;
	     }
	     System.out.println(sum);
	}
	} Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int N = scanner.nextInt(); N scanner.nextInt() scanner.nextInt scanner int K = scanner.nextInt(); K scanner.nextInt() scanner.nextInt scanner if(K>N) {
	    	System.out.println(0);
	    }else {
	    List<Integer> list = new ArrayList<Integer>();
	    for(int i=0;i< N;i++){
	    	list.add(i,scanner.nextInt());
	    }
	    Collections.sort(list,Collections.reverseOrder());
	     long sum = 0;
	     for(int i = K;i < N; i++) {
	    	 sum = list.get(i) + sum;
	     }
	     System.out.println(sum);
	} K>N K N {
	    	System.out.println(0);
	    } System.out.println(0) System.out.println System.out System System.out 0 {
	    List<Integer> list = new ArrayList<Integer>();
	    for(int i=0;i< N;i++){
	    	list.add(i,scanner.nextInt());
	    }
	    Collections.sort(list,Collections.reverseOrder());
	     long sum = 0;
	     for(int i = K;i < N; i++) {
	    	 sum = list.get(i) + sum;
	     }
	     System.out.println(sum);
	} List<Integer> list = new ArrayList<Integer>(); list new ArrayList<Integer>() for(int i=0;i< N;i++){
	    	list.add(i,scanner.nextInt());
	    } int i=0; int i=0; i 0 i< N i N i++ i++ i {
	    	list.add(i,scanner.nextInt());
	    } {
	    	list.add(i,scanner.nextInt());
	    } list.add(i,scanner.nextInt()) list.add list i scanner.nextInt() scanner.nextInt scanner Collections.sort(list,Collections.reverseOrder()) Collections.sort Collections list Collections.reverseOrder() Collections.reverseOrder Collections long sum = 0; sum 0 for(int i = K;i < N; i++) {
	    	 sum = list.get(i) + sum;
	     } int i = K; int i = K; i K i < N i N i++ i++ i {
	    	 sum = list.get(i) + sum;
	     } {
	    	 sum = list.get(i) + sum;
	     } sum = list.get(i) + sum sum list.get(i) + sum list.get(i) list.get list i sum System.out.println(sum) System.out.println System.out System System.out sum String[] args args public class Main {

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
	    
	    int N = scanner.nextInt();
	    int K = scanner.nextInt();
	    if(K>N) {
	    	System.out.println(0);
	    }else {
	    List<Integer> list = new ArrayList<Integer>();
	    for(int i=0;i< N;i++){
	    	list.add(i,scanner.nextInt());
	    }
	    Collections.sort(list,Collections.reverseOrder());
	     long sum = 0;
	     for(int i = K;i < N; i++) {
	    	 sum = list.get(i) + sum;
	     }
	     System.out.println(sum);
	}
	}
} public class Main {

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
	    
	    int N = scanner.nextInt();
	    int K = scanner.nextInt();
	    if(K>N) {
	    	System.out.println(0);
	    }else {
	    List<Integer> list = new ArrayList<Integer>();
	    for(int i=0;i< N;i++){
	    	list.add(i,scanner.nextInt());
	    }
	    Collections.sort(list,Collections.reverseOrder());
	     long sum = 0;
	     for(int i = K;i < N; i++) {
	    	 sum = list.get(i) + sum;
	     }
	     System.out.println(sum);
	}
	}
} Main
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
	    
	    int N = scanner.nextInt();
	    int K = scanner.nextInt();
	    if(K>N) {
	    	System.out.println(0);
	    }else {
	    List<Integer> list = new ArrayList<Integer>();
	    for(int i=0;i< N;i++){
	    	list.add(i,scanner.nextInt());
	    }
	    Collections.sort(list,Collections.reverseOrder());
	     long sum = 0;
	     for(int i = K;i < N; i++) {
	    	 sum = list.get(i) + sum;
	     }
	     System.out.println(sum);
	}
	}
}
