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

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int k = scan.nextInt();
		int[] h = new int[n];
		long ans = 0;

		for (int i = 0; i < n; i++)
			h[i] = scan.nextInt();

		Arrays.sort(h);

		for (int i = 0; i < n - k; i++)
			ans += h[i];

		System.out.println(ans);

		scan.close();
	}
} import java.util.Arrays; Arrays java.util import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int k = scan.nextInt();
		int[] h = new int[n];
		long ans = 0;

		for (int i = 0; i < n; i++)
			h[i] = scan.nextInt();

		Arrays.sort(h);

		for (int i = 0; i < n - k; i++)
			ans += h[i];

		System.out.println(ans);

		scan.close();
	}
} Main public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int k = scan.nextInt();
		int[] h = new int[n];
		long ans = 0;

		for (int i = 0; i < n; i++)
			h[i] = scan.nextInt();

		Arrays.sort(h);

		for (int i = 0; i < n - k; i++)
			ans += h[i];

		System.out.println(ans);

		scan.close();
	} main {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int k = scan.nextInt();
		int[] h = new int[n];
		long ans = 0;

		for (int i = 0; i < n; i++)
			h[i] = scan.nextInt();

		Arrays.sort(h);

		for (int i = 0; i < n - k; i++)
			ans += h[i];

		System.out.println(ans);

		scan.close();
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int n = scan.nextInt(); n scan.nextInt() scan.nextInt scan int k = scan.nextInt(); k scan.nextInt() scan.nextInt scan int[] h = new int[n]; h new int[n] n long ans = 0; ans 0 for (int i = 0; i < n; i++)
			h[i] = scan.nextInt(); int i = 0; int i = 0; i 0 i < n i n i++ i++ i h[i] = scan.nextInt(); h[i] = scan.nextInt() h[i] h i scan.nextInt() scan.nextInt scan Arrays.sort(h) Arrays.sort Arrays h for (int i = 0; i < n - k; i++)
			ans += h[i]; int i = 0; int i = 0; i 0 i < n - k i n - k n k i++ i++ i ans += h[i]; ans += h[i] ans h[i] h i System.out.println(ans) System.out.println System.out System System.out ans scan.close() scan.close scan String[] args args public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int k = scan.nextInt();
		int[] h = new int[n];
		long ans = 0;

		for (int i = 0; i < n; i++)
			h[i] = scan.nextInt();

		Arrays.sort(h);

		for (int i = 0; i < n - k; i++)
			ans += h[i];

		System.out.println(ans);

		scan.close();
	}
} public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int k = scan.nextInt();
		int[] h = new int[n];
		long ans = 0;

		for (int i = 0; i < n; i++)
			h[i] = scan.nextInt();

		Arrays.sort(h);

		for (int i = 0; i < n - k; i++)
			ans += h[i];

		System.out.println(ans);

		scan.close();
	}
} Main
import java.util.Arrays;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int k = scan.nextInt();
		int[] h = new int[n];
		long ans = 0;

		for (int i = 0; i < n; i++)
			h[i] = scan.nextInt();

		Arrays.sort(h);

		for (int i = 0; i < n - k; i++)
			ans += h[i];

		System.out.println(ans);

		scan.close();
	}
}