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

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int N = sc.nextInt();
		int K = sc.nextInt();
		Long[] H = new Long[N];

		for (int i = 0; i < N; i++) {
			H[i] = sc.nextLong();
		}

		if (K >= N) {
			System.out.println(0); // 全て必殺技
		} else {
			Arrays.sort(H, Collections.reverseOrder());

			Long[] M = Arrays.copyOfRange(H, K, H.length);
			long sum = 0;

			for (int i = 0; i < M.length; i++) {
				sum += M[i];
			}

			System.out.println(sum);
		}

		sc.close();
	}

} import java.util.Arrays; Arrays java.util import java.util.Collections; Collections java.util import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int N = sc.nextInt();
		int K = sc.nextInt();
		Long[] H = new Long[N];

		for (int i = 0; i < N; i++) {
			H[i] = sc.nextLong();
		}

		if (K >= N) {
			System.out.println(0); // 全て必殺技
		} else {
			Arrays.sort(H, Collections.reverseOrder());

			Long[] M = Arrays.copyOfRange(H, K, H.length);
			long sum = 0;

			for (int i = 0; i < M.length; i++) {
				sum += M[i];
			}

			System.out.println(sum);
		}

		sc.close();
	}

} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int N = sc.nextInt();
		int K = sc.nextInt();
		Long[] H = new Long[N];

		for (int i = 0; i < N; i++) {
			H[i] = sc.nextLong();
		}

		if (K >= N) {
			System.out.println(0); // 全て必殺技
		} else {
			Arrays.sort(H, Collections.reverseOrder());

			Long[] M = Arrays.copyOfRange(H, K, H.length);
			long sum = 0;

			for (int i = 0; i < M.length; i++) {
				sum += M[i];
			}

			System.out.println(sum);
		}

		sc.close();
	} main {
		Scanner sc = new Scanner(System.in);

		int N = sc.nextInt();
		int K = sc.nextInt();
		Long[] H = new Long[N];

		for (int i = 0; i < N; i++) {
			H[i] = sc.nextLong();
		}

		if (K >= N) {
			System.out.println(0); // 全て必殺技
		} else {
			Arrays.sort(H, Collections.reverseOrder());

			Long[] M = Arrays.copyOfRange(H, K, H.length);
			long sum = 0;

			for (int i = 0; i < M.length; i++) {
				sum += M[i];
			}

			System.out.println(sum);
		}

		sc.close();
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc int K = sc.nextInt(); K sc.nextInt() sc.nextInt sc Long[] H = new Long[N]; H new Long[N] N 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 if (K >= N) {
			System.out.println(0); // 全て必殺技
		} else {
			Arrays.sort(H, Collections.reverseOrder());

			Long[] M = Arrays.copyOfRange(H, K, H.length);
			long sum = 0;

			for (int i = 0; i < M.length; i++) {
				sum += M[i];
			}

			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 {
			Arrays.sort(H, Collections.reverseOrder());

			Long[] M = Arrays.copyOfRange(H, K, H.length);
			long sum = 0;

			for (int i = 0; i < M.length; i++) {
				sum += M[i];
			}

			System.out.println(sum);
		} Arrays.sort(H, Collections.reverseOrder()) Arrays.sort Arrays H Collections.reverseOrder() Collections.reverseOrder Collections Long[] M = Arrays.copyOfRange(H, K, H.length); M Arrays.copyOfRange(H, K, H.length) Arrays.copyOfRange Arrays H K H.length H H.length long sum = 0; sum 0 for (int i = 0; i < M.length; i++) {
				sum += M[i];
			} int i = 0; int i = 0; i 0 i < M.length i M.length M M.length i++ i++ i {
				sum += M[i];
			} {
				sum += M[i];
			} sum += M[i] sum M[i] M i System.out.println(sum) System.out.println System.out System System.out sum sc.close() sc.close sc String[] args args public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int N = sc.nextInt();
		int K = sc.nextInt();
		Long[] H = new Long[N];

		for (int i = 0; i < N; i++) {
			H[i] = sc.nextLong();
		}

		if (K >= N) {
			System.out.println(0); // 全て必殺技
		} else {
			Arrays.sort(H, Collections.reverseOrder());

			Long[] M = Arrays.copyOfRange(H, K, H.length);
			long sum = 0;

			for (int i = 0; i < M.length; i++) {
				sum += M[i];
			}

			System.out.println(sum);
		}

		sc.close();
	}

} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int N = sc.nextInt();
		int K = sc.nextInt();
		Long[] H = new Long[N];

		for (int i = 0; i < N; i++) {
			H[i] = sc.nextLong();
		}

		if (K >= N) {
			System.out.println(0); // 全て必殺技
		} else {
			Arrays.sort(H, Collections.reverseOrder());

			Long[] M = Arrays.copyOfRange(H, K, H.length);
			long sum = 0;

			for (int i = 0; i < M.length; i++) {
				sum += M[i];
			}

			System.out.println(sum);
		}

		sc.close();
	}

} Main
import java.util.Arrays;
import java.util.Collections;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int N = sc.nextInt();
		int K = sc.nextInt();
		Long[] H = new Long[N];

		for (int i = 0; i < N; i++) {
			H[i] = sc.nextLong();
		}

		if (K >= N) {
			System.out.println(0); // 全て必殺技
		} else {
			Arrays.sort(H, Collections.reverseOrder());

			Long[] M = Arrays.copyOfRange(H, K, H.length);
			long sum = 0;

			for (int i = 0; i < M.length; i++) {
				sum += M[i];
			}

			System.out.println(sum);
		}

		sc.close();
	}

}
