import java.util.Arrays;
import java.util.Collections;
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();
		Integer[] A = new Integer[N];
		for(int i=0; i<N; i++) {
			A[i] = sc.nextInt();
		}
		sc.close();
		if(N<=K) {
			System.out.println(0);
			return;
		}
		Arrays.sort(A,  Collections.reverseOrder());
		long s = 0;
		for(int i=K; i<N; i++) {
				s += A[i];
		}
		System.out.println(s);
	}

} import java.util.Arrays; Arrays java.util import java.util.Collections; Collections 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();
		Integer[] A = new Integer[N];
		for(int i=0; i<N; i++) {
			A[i] = sc.nextInt();
		}
		sc.close();
		if(N<=K) {
			System.out.println(0);
			return;
		}
		Arrays.sort(A,  Collections.reverseOrder());
		long s = 0;
		for(int i=K; i<N; i++) {
				s += A[i];
		}
		System.out.println(s);
	}

} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int K = sc.nextInt();
		Integer[] A = new Integer[N];
		for(int i=0; i<N; i++) {
			A[i] = sc.nextInt();
		}
		sc.close();
		if(N<=K) {
			System.out.println(0);
			return;
		}
		Arrays.sort(A,  Collections.reverseOrder());
		long s = 0;
		for(int i=K; i<N; i++) {
				s += A[i];
		}
		System.out.println(s);
	} main {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int K = sc.nextInt();
		Integer[] A = new Integer[N];
		for(int i=0; i<N; i++) {
			A[i] = sc.nextInt();
		}
		sc.close();
		if(N<=K) {
			System.out.println(0);
			return;
		}
		Arrays.sort(A,  Collections.reverseOrder());
		long s = 0;
		for(int i=K; i<N; i++) {
				s += A[i];
		}
		System.out.println(s);
	} 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 Integer[] A = new Integer[N]; A new Integer[N] N for(int i=0; i<N; i++) {
			A[i] = sc.nextInt();
		} int i=0; int i=0; i 0 i<N i N i++ i++ i {
			A[i] = sc.nextInt();
		} {
			A[i] = sc.nextInt();
		} A[i] = sc.nextInt() A[i] A i sc.nextInt() sc.nextInt sc sc.close() sc.close sc if(N<=K) {
			System.out.println(0);
			return;
		} N<=K N K {
			System.out.println(0);
			return;
		} System.out.println(0) System.out.println System.out System System.out 0 return; Arrays.sort(A,  Collections.reverseOrder()) Arrays.sort Arrays A Collections.reverseOrder() Collections.reverseOrder Collections long s = 0; s 0 for(int i=K; i<N; i++) {
				s += A[i];
		} int i=K; int i=K; i K i<N i N i++ i++ i {
				s += A[i];
		} {
				s += A[i];
		} s += A[i] s A[i] A i System.out.println(s) System.out.println System.out System System.out s 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();
		Integer[] A = new Integer[N];
		for(int i=0; i<N; i++) {
			A[i] = sc.nextInt();
		}
		sc.close();
		if(N<=K) {
			System.out.println(0);
			return;
		}
		Arrays.sort(A,  Collections.reverseOrder());
		long s = 0;
		for(int i=K; i<N; i++) {
				s += A[i];
		}
		System.out.println(s);
	}

} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int K = sc.nextInt();
		Integer[] A = new Integer[N];
		for(int i=0; i<N; i++) {
			A[i] = sc.nextInt();
		}
		sc.close();
		if(N<=K) {
			System.out.println(0);
			return;
		}
		Arrays.sort(A,  Collections.reverseOrder());
		long s = 0;
		for(int i=K; i<N; i++) {
				s += A[i];
		}
		System.out.println(s);
	}

} Main
import java.util.Arrays;
import java.util.Collections;
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();
		Integer[] A = new Integer[N];
		for(int i=0; i<N; i++) {
			A[i] = sc.nextInt();
		}
		sc.close();
		if(N<=K) {
			System.out.println(0);
			return;
		}
		Arrays.sort(A,  Collections.reverseOrder());
		long s = 0;
		for(int i=K; i<N; i++) {
				s += A[i];
		}
		System.out.println(s);
	}

}