import java.util.Arrays;
import java.util.Scanner;

class Main{
	
	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		long N = sc.nextLong(), K = sc.nextLong();
		long[] H = new long[200005];
		for(int i = 0; i < N; i++) {
			H[i] = sc.nextLong();
		}
		Arrays.sort(H);
		long sum = 0;
		if(N > K) {
			for(int i = (int)(200005 - K - 1); i >= 200005 - N; i--) {
				sum += H[i];
			}
		}
		System.out.print(sum);
		
		sc.close();
		
	}
} import java.util.Arrays; Arrays java.util import java.util.Scanner; Scanner java.util class Main{
	
	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		long N = sc.nextLong(), K = sc.nextLong();
		long[] H = new long[200005];
		for(int i = 0; i < N; i++) {
			H[i] = sc.nextLong();
		}
		Arrays.sort(H);
		long sum = 0;
		if(N > K) {
			for(int i = (int)(200005 - K - 1); i >= 200005 - N; i--) {
				sum += H[i];
			}
		}
		System.out.print(sum);
		
		sc.close();
		
	}
} Main public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		long N = sc.nextLong(), K = sc.nextLong();
		long[] H = new long[200005];
		for(int i = 0; i < N; i++) {
			H[i] = sc.nextLong();
		}
		Arrays.sort(H);
		long sum = 0;
		if(N > K) {
			for(int i = (int)(200005 - K - 1); i >= 200005 - N; i--) {
				sum += H[i];
			}
		}
		System.out.print(sum);
		
		sc.close();
		
	} main {
		Scanner sc = new Scanner(System.in);
		long N = sc.nextLong(), K = sc.nextLong();
		long[] H = new long[200005];
		for(int i = 0; i < N; i++) {
			H[i] = sc.nextLong();
		}
		Arrays.sort(H);
		long sum = 0;
		if(N > K) {
			for(int i = (int)(200005 - K - 1); i >= 200005 - N; i--) {
				sum += H[i];
			}
		}
		System.out.print(sum);
		
		sc.close();
		
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) long N = sc.nextLong() N sc.nextLong() sc.nextLong sc K = sc.nextLong(); K sc.nextLong() sc.nextLong sc long[] H = new long[200005]; H new long[200005] 200005 for(int i = 0; i < N; i++) {
			H[i] = sc.nextLong();
		} int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
			H[i] = sc.nextLong();
		} {
			H[i] = sc.nextLong();
		} H[i] = sc.nextLong() H[i] H i sc.nextLong() sc.nextLong sc Arrays.sort(H) Arrays.sort Arrays H long sum = 0; sum 0 if(N > K) {
			for(int i = (int)(200005 - K - 1); i >= 200005 - N; i--) {
				sum += H[i];
			}
		} N > K N K {
			for(int i = (int)(200005 - K - 1); i >= 200005 - N; i--) {
				sum += H[i];
			}
		} for(int i = (int)(200005 - K - 1); i >= 200005 - N; i--) {
				sum += H[i];
			} int i = (int)(200005 - K - 1); int i = (int)(200005 - K - 1); i (int)(200005 - K - 1) 200005 - K - 1 200005 K 1 i >= 200005 - N i 200005 - N 200005 N i-- i-- i {
				sum += H[i];
			} {
				sum += H[i];
			} sum += H[i] sum H[i] H i System.out.print(sum) System.out.print System.out System System.out sum sc.close() sc.close sc String args[] args
import java.util.Arrays;
import java.util.Scanner;

class Main{
	
	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		long N = sc.nextLong(), K = sc.nextLong();
		long[] H = new long[200005];
		for(int i = 0; i < N; i++) {
			H[i] = sc.nextLong();
		}
		Arrays.sort(H);
		long sum = 0;
		if(N > K) {
			for(int i = (int)(200005 - K - 1); i >= 200005 - N; i--) {
				sum += H[i];
			}
		}
		System.out.print(sum);
		
		sc.close();
		
	}
}
