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

public class Main {
	public static void main(String[] args) {

		try (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 (n <= k) {
				System.out.println(0);
				return;
			}

			Arrays.sort(h, Collections.reverseOrder());

			long sum = 0;
			for (long v : Arrays.copyOfRange(h, k, n)) {
				sum += v;
			}
			System.out.println(sum);
		}
	}
} 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) {

		try (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 (n <= k) {
				System.out.println(0);
				return;
			}

			Arrays.sort(h, Collections.reverseOrder());

			long sum = 0;
			for (long v : Arrays.copyOfRange(h, k, n)) {
				sum += v;
			}
			System.out.println(sum);
		}
	}
} Main public static void main(String[] args) {

		try (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 (n <= k) {
				System.out.println(0);
				return;
			}

			Arrays.sort(h, Collections.reverseOrder());

			long sum = 0;
			for (long v : Arrays.copyOfRange(h, k, n)) {
				sum += v;
			}
			System.out.println(sum);
		}
	} main {

		try (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 (n <= k) {
				System.out.println(0);
				return;
			}

			Arrays.sort(h, Collections.reverseOrder());

			long sum = 0;
			for (long v : Arrays.copyOfRange(h, k, n)) {
				sum += v;
			}
			System.out.println(sum);
		}
	} try (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 (n <= k) {
				System.out.println(0);
				return;
			}

			Arrays.sort(h, Collections.reverseOrder());

			long sum = 0;
			for (long v : Arrays.copyOfRange(h, k, n)) {
				sum += v;
			}
			System.out.println(sum);
		} {
			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 (n <= k) {
				System.out.println(0);
				return;
			}

			Arrays.sort(h, Collections.reverseOrder());

			long sum = 0;
			for (long v : Arrays.copyOfRange(h, k, n)) {
				sum += v;
			}
			System.out.println(sum);
		} Scanner sc = new Scanner(System.in) Scanner sc = new Scanner(System.in) 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 (n <= k) {
				System.out.println(0);
				return;
			} n <= k n k {
				System.out.println(0);
				return;
			} System.out.println(0) System.out.println System.out System System.out 0 return; Arrays.sort(h, Collections.reverseOrder()) Arrays.sort Arrays h Collections.reverseOrder() Collections.reverseOrder Collections long sum = 0; sum 0 for (long v : Arrays.copyOfRange(h, k, n)) {
				sum += v;
			} long v Arrays.copyOfRange(h, k, n) Arrays.copyOfRange Arrays h k n {
				sum += v;
			} {
				sum += v;
			} sum += v sum v 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) {

		try (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 (n <= k) {
				System.out.println(0);
				return;
			}

			Arrays.sort(h, Collections.reverseOrder());

			long sum = 0;
			for (long v : Arrays.copyOfRange(h, k, n)) {
				sum += v;
			}
			System.out.println(sum);
		}
	}
} public class Main {
	public static void main(String[] args) {

		try (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 (n <= k) {
				System.out.println(0);
				return;
			}

			Arrays.sort(h, Collections.reverseOrder());

			long sum = 0;
			for (long v : Arrays.copyOfRange(h, k, n)) {
				sum += v;
			}
			System.out.println(sum);
		}
	}
} Main
import java.util.Arrays;
import java.util.Collections;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {

		try (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 (n <= k) {
				System.out.println(0);
				return;
			}

			Arrays.sort(h, Collections.reverseOrder());

			long sum = 0;
			for (long v : Arrays.copyOfRange(h, k, n)) {
				sum += v;
			}
			System.out.println(sum);
		}
	}
}
