import java.util.Arrays;
 
public class Main {
	
	public static void main(String[] args) {
		
		java.util.Scanner scan = new java.util.Scanner(System.in);
 
		
		int N = scan.nextInt();
		int K = scan.nextInt();
		long[] H = new long[N];
		long sum = 0;
		
		
		for (int i = 0; i < N; i++) {
			H[i] = scan.nextLong();
		}
		
		if(K >= N ) {
			System.out.println(0);
			return;
		} 
		
		Arrays.sort(H);
		
		
		for(int i =N-1; K>0  ; i--) {
			H[i] = 0;
			K--;
		}
	
		for(long h : H) {
			sum += h;
		}
	
			System.out.println(sum);
		}
	
	} import java.util.Arrays; Arrays java.util public class Main {
	
	public static void main(String[] args) {
		
		java.util.Scanner scan = new java.util.Scanner(System.in);
 
		
		int N = scan.nextInt();
		int K = scan.nextInt();
		long[] H = new long[N];
		long sum = 0;
		
		
		for (int i = 0; i < N; i++) {
			H[i] = scan.nextLong();
		}
		
		if(K >= N ) {
			System.out.println(0);
			return;
		} 
		
		Arrays.sort(H);
		
		
		for(int i =N-1; K>0  ; i--) {
			H[i] = 0;
			K--;
		}
	
		for(long h : H) {
			sum += h;
		}
	
			System.out.println(sum);
		}
	
	} Main public static void main(String[] args) {
		
		java.util.Scanner scan = new java.util.Scanner(System.in);
 
		
		int N = scan.nextInt();
		int K = scan.nextInt();
		long[] H = new long[N];
		long sum = 0;
		
		
		for (int i = 0; i < N; i++) {
			H[i] = scan.nextLong();
		}
		
		if(K >= N ) {
			System.out.println(0);
			return;
		} 
		
		Arrays.sort(H);
		
		
		for(int i =N-1; K>0  ; i--) {
			H[i] = 0;
			K--;
		}
	
		for(long h : H) {
			sum += h;
		}
	
			System.out.println(sum);
		} main {
		
		java.util.Scanner scan = new java.util.Scanner(System.in);
 
		
		int N = scan.nextInt();
		int K = scan.nextInt();
		long[] H = new long[N];
		long sum = 0;
		
		
		for (int i = 0; i < N; i++) {
			H[i] = scan.nextLong();
		}
		
		if(K >= N ) {
			System.out.println(0);
			return;
		} 
		
		Arrays.sort(H);
		
		
		for(int i =N-1; K>0  ; i--) {
			H[i] = 0;
			K--;
		}
	
		for(long h : H) {
			sum += h;
		}
	
			System.out.println(sum);
		} java.util.Scanner scan = new java.util.Scanner(System.in); scan new java.util.Scanner(System.in) int N = scan.nextInt(); N scan.nextInt() scan.nextInt scan int K = scan.nextInt(); K scan.nextInt() scan.nextInt scan long[] H = new long[N]; H new long[N] N long sum = 0; sum 0 for (int i = 0; i < N; i++) {
			H[i] = scan.nextLong();
		} int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
			H[i] = scan.nextLong();
		} {
			H[i] = scan.nextLong();
		} H[i] = scan.nextLong() H[i] H i scan.nextLong() scan.nextLong scan if(K >= N ) {
			System.out.println(0);
			return;
		} K >= N K N {
			System.out.println(0);
			return;
		} System.out.println(0) System.out.println System.out System System.out 0 return; Arrays.sort(H) Arrays.sort Arrays H for(int i =N-1; K>0  ; i--) {
			H[i] = 0;
			K--;
		} int i =N-1; int i =N-1; i N-1 N 1 K>0 K 0 i-- i-- i {
			H[i] = 0;
			K--;
		} {
			H[i] = 0;
			K--;
		} H[i] = 0 H[i] H i 0 K-- K for(long h : H) {
			sum += h;
		} long h H {
			sum += h;
		} {
			sum += h;
		} sum += h sum h 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) {
		
		java.util.Scanner scan = new java.util.Scanner(System.in);
 
		
		int N = scan.nextInt();
		int K = scan.nextInt();
		long[] H = new long[N];
		long sum = 0;
		
		
		for (int i = 0; i < N; i++) {
			H[i] = scan.nextLong();
		}
		
		if(K >= N ) {
			System.out.println(0);
			return;
		} 
		
		Arrays.sort(H);
		
		
		for(int i =N-1; K>0  ; i--) {
			H[i] = 0;
			K--;
		}
	
		for(long h : H) {
			sum += h;
		}
	
			System.out.println(sum);
		}
	
	} public class Main {
	
	public static void main(String[] args) {
		
		java.util.Scanner scan = new java.util.Scanner(System.in);
 
		
		int N = scan.nextInt();
		int K = scan.nextInt();
		long[] H = new long[N];
		long sum = 0;
		
		
		for (int i = 0; i < N; i++) {
			H[i] = scan.nextLong();
		}
		
		if(K >= N ) {
			System.out.println(0);
			return;
		} 
		
		Arrays.sort(H);
		
		
		for(int i =N-1; K>0  ; i--) {
			H[i] = 0;
			K--;
		}
	
		for(long h : H) {
			sum += h;
		}
	
			System.out.println(sum);
		}
	
	} Main
import java.util.Arrays;
 
public class Main {
	
	public static void main(String[] args) {
		
		java.util.Scanner scan = new java.util.Scanner(System.in);
 
		
		int N = scan.nextInt();
		int K = scan.nextInt();
		long[] H = new long[N];
		long sum = 0;
		
		
		for (int i = 0; i < N; i++) {
			H[i] = scan.nextLong();
		}
		
		if(K >= N ) {
			System.out.println(0);
			return;
		} 
		
		Arrays.sort(H);
		
		
		for(int i =N-1; K>0  ; i--) {
			H[i] = 0;
			K--;
		}
	
		for(long h : H) {
			sum += h;
		}
	
			System.out.println(sum);
		}
	
	}
