import java.util.Arrays;
import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt(), k = sc.nextInt();
		long[] h = new long[n];
		long ans = 0;
		for (int i = 0; i < n; i++) h[i] = sc.nextLong();
		Arrays.parallelSort(h);
		for (int i = 0; i < n-k; i++) ans += h[i];
		System.out.println(ans);
	}
} import java.util.Arrays; Arrays 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(), k = sc.nextInt();
		long[] h = new long[n];
		long ans = 0;
		for (int i = 0; i < n; i++) h[i] = sc.nextLong();
		Arrays.parallelSort(h);
		for (int i = 0; i < n-k; i++) ans += h[i];
		System.out.println(ans);
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt(), k = sc.nextInt();
		long[] h = new long[n];
		long ans = 0;
		for (int i = 0; i < n; i++) h[i] = sc.nextLong();
		Arrays.parallelSort(h);
		for (int i = 0; i < n-k; i++) ans += h[i];
		System.out.println(ans);
	} main {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt(), k = sc.nextInt();
		long[] h = new long[n];
		long ans = 0;
		for (int i = 0; i < n; i++) h[i] = sc.nextLong();
		Arrays.parallelSort(h);
		for (int i = 0; i < n-k; i++) ans += h[i];
		System.out.println(ans);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt() n sc.nextInt() sc.nextInt sc k = sc.nextInt(); k sc.nextInt() sc.nextInt sc long[] h = new long[n]; h new long[n] n long ans = 0; ans 0 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] h i sc.nextLong() sc.nextLong sc Arrays.parallelSort(h) Arrays.parallelSort 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 String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt(), k = sc.nextInt();
		long[] h = new long[n];
		long ans = 0;
		for (int i = 0; i < n; i++) h[i] = sc.nextLong();
		Arrays.parallelSort(h);
		for (int i = 0; i < n-k; i++) ans += h[i];
		System.out.println(ans);
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt(), k = sc.nextInt();
		long[] h = new long[n];
		long ans = 0;
		for (int i = 0; i < n; i++) h[i] = sc.nextLong();
		Arrays.parallelSort(h);
		for (int i = 0; i < n-k; i++) ans += h[i];
		System.out.println(ans);
	}
} Main
import java.util.Arrays;
import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt(), k = sc.nextInt();
		long[] h = new long[n];
		long ans = 0;
		for (int i = 0; i < n; i++) h[i] = sc.nextLong();
		Arrays.parallelSort(h);
		for (int i = 0; i < n-k; i++) ans += h[i];
		System.out.println(ans);
	}
}