import java.util.Arrays;
import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long N = sc.nextLong(), K = sc.nextLong();
		long[] mon = new long[(int)N];
		for(int i = 0; i < N; i++) {
			mon[i] = sc.nextLong();
		}
		Arrays.sort(mon);
		if(N<=K) {
			System.out.println(0);
		}else {
			for(int j = (int)N-1; j >= N-K; j--) {
				mon[j] = 0;
			}
			long sum = Arrays.stream(mon).sum();
			System.out.println(sum);
		}
	}
} 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);
		long N = sc.nextLong(), K = sc.nextLong();
		long[] mon = new long[(int)N];
		for(int i = 0; i < N; i++) {
			mon[i] = sc.nextLong();
		}
		Arrays.sort(mon);
		if(N<=K) {
			System.out.println(0);
		}else {
			for(int j = (int)N-1; j >= N-K; j--) {
				mon[j] = 0;
			}
			long sum = Arrays.stream(mon).sum();
			System.out.println(sum);
		}
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long N = sc.nextLong(), K = sc.nextLong();
		long[] mon = new long[(int)N];
		for(int i = 0; i < N; i++) {
			mon[i] = sc.nextLong();
		}
		Arrays.sort(mon);
		if(N<=K) {
			System.out.println(0);
		}else {
			for(int j = (int)N-1; j >= N-K; j--) {
				mon[j] = 0;
			}
			long sum = Arrays.stream(mon).sum();
			System.out.println(sum);
		}
	} main {
		Scanner sc = new Scanner(System.in);
		long N = sc.nextLong(), K = sc.nextLong();
		long[] mon = new long[(int)N];
		for(int i = 0; i < N; i++) {
			mon[i] = sc.nextLong();
		}
		Arrays.sort(mon);
		if(N<=K) {
			System.out.println(0);
		}else {
			for(int j = (int)N-1; j >= N-K; j--) {
				mon[j] = 0;
			}
			long sum = Arrays.stream(mon).sum();
			System.out.println(sum);
		}
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) long N = sc.nextLong() N sc.nextLong() sc.nextLong sc K = sc.nextLong(); K sc.nextLong() sc.nextLong sc long[] mon = new long[(int)N]; mon new long[(int)N] (int)N for(int i = 0; i < N; i++) {
			mon[i] = sc.nextLong();
		} int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
			mon[i] = sc.nextLong();
		} {
			mon[i] = sc.nextLong();
		} mon[i] = sc.nextLong() mon[i] mon i sc.nextLong() sc.nextLong sc Arrays.sort(mon) Arrays.sort Arrays mon if(N<=K) {
			System.out.println(0);
		}else {
			for(int j = (int)N-1; j >= N-K; j--) {
				mon[j] = 0;
			}
			long sum = Arrays.stream(mon).sum();
			System.out.println(sum);
		} N<=K N K {
			System.out.println(0);
		} System.out.println(0) System.out.println System.out System System.out 0 {
			for(int j = (int)N-1; j >= N-K; j--) {
				mon[j] = 0;
			}
			long sum = Arrays.stream(mon).sum();
			System.out.println(sum);
		} for(int j = (int)N-1; j >= N-K; j--) {
				mon[j] = 0;
			} int j = (int)N-1; int j = (int)N-1; j (int)N-1 (int)N 1 j >= N-K j N-K N K j-- j-- j {
				mon[j] = 0;
			} {
				mon[j] = 0;
			} mon[j] = 0 mon[j] mon j 0 long sum = Arrays.stream(mon).sum(); sum Arrays.stream(mon).sum() Arrays.stream(mon).sum Arrays.stream(mon) Arrays.stream Arrays mon 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) {
		Scanner sc = new Scanner(System.in);
		long N = sc.nextLong(), K = sc.nextLong();
		long[] mon = new long[(int)N];
		for(int i = 0; i < N; i++) {
			mon[i] = sc.nextLong();
		}
		Arrays.sort(mon);
		if(N<=K) {
			System.out.println(0);
		}else {
			for(int j = (int)N-1; j >= N-K; j--) {
				mon[j] = 0;
			}
			long sum = Arrays.stream(mon).sum();
			System.out.println(sum);
		}
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long N = sc.nextLong(), K = sc.nextLong();
		long[] mon = new long[(int)N];
		for(int i = 0; i < N; i++) {
			mon[i] = sc.nextLong();
		}
		Arrays.sort(mon);
		if(N<=K) {
			System.out.println(0);
		}else {
			for(int j = (int)N-1; j >= N-K; j--) {
				mon[j] = 0;
			}
			long sum = Arrays.stream(mon).sum();
			System.out.println(sum);
		}
	}
} Main
import java.util.Arrays;
import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long N = sc.nextLong(), K = sc.nextLong();
		long[] mon = new long[(int)N];
		for(int i = 0; i < N; i++) {
			mon[i] = sc.nextLong();
		}
		Arrays.sort(mon);
		if(N<=K) {
			System.out.println(0);
		}else {
			for(int j = (int)N-1; j >= N-K; j--) {
				mon[j] = 0;
			}
			long sum = Arrays.stream(mon).sum();
			System.out.println(sum);
		}
	}
}