import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;



public class Main {
	public static void main(String[] args) throws IOException {
		
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String[] parts = br.readLine().split(" ");
		
		long N = Integer.parseInt(parts[0]);
		long  K = Integer.parseInt(parts[1]);
		
		parts = br.readLine().split(" ");
		
		long[] H = new long[parts.length];
		
		for (int i = 0; i < H.length; i++) {
			H[i] = Integer.parseInt(parts[i]);
		}
		
		Arrays.sort(H);

		
		long sum = 0;
		for (int i = 0; i < H.length-K; i++) {
			sum += H[i];
	
		}
		
		System.out.println(sum);
		
		
		
	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.Arrays; Arrays java.util public class Main {
	public static void main(String[] args) throws IOException {
		
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String[] parts = br.readLine().split(" ");
		
		long N = Integer.parseInt(parts[0]);
		long  K = Integer.parseInt(parts[1]);
		
		parts = br.readLine().split(" ");
		
		long[] H = new long[parts.length];
		
		for (int i = 0; i < H.length; i++) {
			H[i] = Integer.parseInt(parts[i]);
		}
		
		Arrays.sort(H);

		
		long sum = 0;
		for (int i = 0; i < H.length-K; i++) {
			sum += H[i];
	
		}
		
		System.out.println(sum);
		
		
		
	}
} Main public static void main(String[] args) throws IOException {
		
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String[] parts = br.readLine().split(" ");
		
		long N = Integer.parseInt(parts[0]);
		long  K = Integer.parseInt(parts[1]);
		
		parts = br.readLine().split(" ");
		
		long[] H = new long[parts.length];
		
		for (int i = 0; i < H.length; i++) {
			H[i] = Integer.parseInt(parts[i]);
		}
		
		Arrays.sort(H);

		
		long sum = 0;
		for (int i = 0; i < H.length-K; i++) {
			sum += H[i];
	
		}
		
		System.out.println(sum);
		
		
		
	} main {
		
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String[] parts = br.readLine().split(" ");
		
		long N = Integer.parseInt(parts[0]);
		long  K = Integer.parseInt(parts[1]);
		
		parts = br.readLine().split(" ");
		
		long[] H = new long[parts.length];
		
		for (int i = 0; i < H.length; i++) {
			H[i] = Integer.parseInt(parts[i]);
		}
		
		Arrays.sort(H);

		
		long sum = 0;
		for (int i = 0; i < H.length-K; i++) {
			sum += H[i];
	
		}
		
		System.out.println(sum);
		
		
		
	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) String[] parts = br.readLine().split(" "); parts br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " long N = Integer.parseInt(parts[0]); N Integer.parseInt(parts[0]) Integer.parseInt Integer parts[0] parts 0 long  K = Integer.parseInt(parts[1]); K Integer.parseInt(parts[1]) Integer.parseInt Integer parts[1] parts 1 parts = br.readLine().split(" ") parts br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " long[] H = new long[parts.length]; H new long[parts.length] parts.length parts parts.length for (int i = 0; i < H.length; i++) {
			H[i] = Integer.parseInt(parts[i]);
		} int i = 0; int i = 0; i 0 i < H.length i H.length H H.length i++ i++ i {
			H[i] = Integer.parseInt(parts[i]);
		} {
			H[i] = Integer.parseInt(parts[i]);
		} H[i] = Integer.parseInt(parts[i]) H[i] H i Integer.parseInt(parts[i]) Integer.parseInt Integer parts[i] parts i Arrays.sort(H) Arrays.sort Arrays H long sum = 0; sum 0 for (int i = 0; i < H.length-K; i++) {
			sum += H[i];
	
		} int i = 0; int i = 0; i 0 i < H.length-K i H.length-K H.length H H.length K i++ i++ i {
			sum += H[i];
	
		} {
			sum += H[i];
	
		} sum += H[i] sum H[i] H i 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) throws IOException {
		
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String[] parts = br.readLine().split(" ");
		
		long N = Integer.parseInt(parts[0]);
		long  K = Integer.parseInt(parts[1]);
		
		parts = br.readLine().split(" ");
		
		long[] H = new long[parts.length];
		
		for (int i = 0; i < H.length; i++) {
			H[i] = Integer.parseInt(parts[i]);
		}
		
		Arrays.sort(H);

		
		long sum = 0;
		for (int i = 0; i < H.length-K; i++) {
			sum += H[i];
	
		}
		
		System.out.println(sum);
		
		
		
	}
} public class Main {
	public static void main(String[] args) throws IOException {
		
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String[] parts = br.readLine().split(" ");
		
		long N = Integer.parseInt(parts[0]);
		long  K = Integer.parseInt(parts[1]);
		
		parts = br.readLine().split(" ");
		
		long[] H = new long[parts.length];
		
		for (int i = 0; i < H.length; i++) {
			H[i] = Integer.parseInt(parts[i]);
		}
		
		Arrays.sort(H);

		
		long sum = 0;
		for (int i = 0; i < H.length-K; i++) {
			sum += H[i];
	
		}
		
		System.out.println(sum);
		
		
		
	}
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;



public class Main {
	public static void main(String[] args) throws IOException {
		
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String[] parts = br.readLine().split(" ");
		
		long N = Integer.parseInt(parts[0]);
		long  K = Integer.parseInt(parts[1]);
		
		parts = br.readLine().split(" ");
		
		long[] H = new long[parts.length];
		
		for (int i = 0; i < H.length; i++) {
			H[i] = Integer.parseInt(parts[i]);
		}
		
		Arrays.sort(H);

		
		long sum = 0;
		for (int i = 0; i < H.length-K; i++) {
			sum += H[i];
	
		}
		
		System.out.println(sum);
		
		
		
	}
}
