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();
		int K = sc.nextInt();
		long con =0;

		long[] monsters = new long[N];

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

		Arrays.sort(monsters);

		for (int i = 0; i < N - K; i++) {
			con += monsters[i];
		}

		System.out.println(con);

	}
} 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();
		int K = sc.nextInt();
		long con =0;

		long[] monsters = new long[N];

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

		Arrays.sort(monsters);

		for (int i = 0; i < N - K; i++) {
			con += monsters[i];
		}

		System.out.println(con);

	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int K = sc.nextInt();
		long con =0;

		long[] monsters = new long[N];

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

		Arrays.sort(monsters);

		for (int i = 0; i < N - K; i++) {
			con += monsters[i];
		}

		System.out.println(con);

	} main {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int K = sc.nextInt();
		long con =0;

		long[] monsters = new long[N];

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

		Arrays.sort(monsters);

		for (int i = 0; i < N - K; i++) {
			con += monsters[i];
		}

		System.out.println(con);

	} 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 con =0; con 0 long[] monsters = new long[N]; monsters new long[N] N for (int i = 0; i < N; i++) {
			monsters[i] += sc.nextLong();
		} int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
			monsters[i] += sc.nextLong();
		} {
			monsters[i] += sc.nextLong();
		} monsters[i] += sc.nextLong() monsters[i] monsters i sc.nextLong() sc.nextLong sc Arrays.sort(monsters) Arrays.sort Arrays monsters for (int i = 0; i < N - K; i++) {
			con += monsters[i];
		} int i = 0; int i = 0; i 0 i < N - K i N - K N K i++ i++ i {
			con += monsters[i];
		} {
			con += monsters[i];
		} con += monsters[i] con monsters[i] monsters i System.out.println(con) System.out.println System.out System System.out con 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 con =0;

		long[] monsters = new long[N];

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

		Arrays.sort(monsters);

		for (int i = 0; i < N - K; i++) {
			con += monsters[i];
		}

		System.out.println(con);

	}
} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int K = sc.nextInt();
		long con =0;

		long[] monsters = new long[N];

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

		Arrays.sort(monsters);

		for (int i = 0; i < N - K; i++) {
			con += monsters[i];
		}

		System.out.println(con);

	}
} 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();
		int K = sc.nextInt();
		long con =0;

		long[] monsters = new long[N];

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

		Arrays.sort(monsters);

		for (int i = 0; i < N - K; i++) {
			con += monsters[i];
		}

		System.out.println(con);

	}
}