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

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ

		Scanner sc = new Scanner(System.in);

		int N = sc.nextInt();
		int K = sc.nextInt();

		Long[] a = new Long[N];

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

		long ans = 0;

		for (int i = 0; i < N - K; i++) {
			ans += a[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) {
		// TODO 自動生成されたメソッド・スタブ

		Scanner sc = new Scanner(System.in);

		int N = sc.nextInt();
		int K = sc.nextInt();

		Long[] a = new Long[N];

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

		long ans = 0;

		for (int i = 0; i < N - K; i++) {
			ans += a[i];
		}
		System.out.println(ans);
	}
} Main public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ

		Scanner sc = new Scanner(System.in);

		int N = sc.nextInt();
		int K = sc.nextInt();

		Long[] a = new Long[N];

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

		long ans = 0;

		for (int i = 0; i < N - K; i++) {
			ans += a[i];
		}
		System.out.println(ans);
	} main {
		// TODO 自動生成されたメソッド・スタブ

		Scanner sc = new Scanner(System.in);

		int N = sc.nextInt();
		int K = sc.nextInt();

		Long[] a = new Long[N];

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

		long ans = 0;

		for (int i = 0; i < N - K; i++) {
			ans += a[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 int K = sc.nextInt(); K sc.nextInt() sc.nextInt sc Long[] a = new Long[N]; a new Long[N] N for (int i = 0; i < N; i++) {
			a[i] = sc.nextLong();
		} int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
			a[i] = sc.nextLong();
		} {
			a[i] = sc.nextLong();
		} a[i] = sc.nextLong() a[i] a i sc.nextLong() sc.nextLong sc Arrays.sort(a) Arrays.sort Arrays a long ans = 0; ans 0 for (int i = 0; i < N - K; i++) {
			ans += a[i];
		} int i = 0; int i = 0; i 0 i < N - K i N - K N K i++ i++ i {
			ans += a[i];
		} {
			ans += a[i];
		} ans += a[i] ans a[i] a 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) {
		// TODO 自動生成されたメソッド・スタブ

		Scanner sc = new Scanner(System.in);

		int N = sc.nextInt();
		int K = sc.nextInt();

		Long[] a = new Long[N];

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

		long ans = 0;

		for (int i = 0; i < N - K; i++) {
			ans += a[i];
		}
		System.out.println(ans);
	}
} public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ

		Scanner sc = new Scanner(System.in);

		int N = sc.nextInt();
		int K = sc.nextInt();

		Long[] a = new Long[N];

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

		long ans = 0;

		for (int i = 0; i < N - K; i++) {
			ans += a[i];
		}
		System.out.println(ans);
	}
} Main
import java.util.Arrays;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ

		Scanner sc = new Scanner(System.in);

		int N = sc.nextInt();
		int K = sc.nextInt();

		Long[] a = new Long[N];

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

		long ans = 0;

		for (int i = 0; i < N - K; i++) {
			ans += a[i];
		}
		System.out.println(ans);
	}
}