import 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();
		List<Long> HP = new ArrayList<>();

		for(int i=0; i<N; i++) {
			HP.add(sc.nextLong());
		}
		Collections.sort(HP);
		Collections.reverse(HP);
		
		if(N<K) {
			System.out.println(0);
			return;
		}
		long answer = 0;
		
		for(int i=K; i<N; i++) {
			answer += HP.get(i);
		}
		System.out.println(answer);
	}		
} import java.util.*; util.* java public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int K = sc.nextInt();
		List<Long> HP = new ArrayList<>();

		for(int i=0; i<N; i++) {
			HP.add(sc.nextLong());
		}
		Collections.sort(HP);
		Collections.reverse(HP);
		
		if(N<K) {
			System.out.println(0);
			return;
		}
		long answer = 0;
		
		for(int i=K; i<N; i++) {
			answer += HP.get(i);
		}
		System.out.println(answer);
	}		
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int K = sc.nextInt();
		List<Long> HP = new ArrayList<>();

		for(int i=0; i<N; i++) {
			HP.add(sc.nextLong());
		}
		Collections.sort(HP);
		Collections.reverse(HP);
		
		if(N<K) {
			System.out.println(0);
			return;
		}
		long answer = 0;
		
		for(int i=K; i<N; i++) {
			answer += HP.get(i);
		}
		System.out.println(answer);
	} main {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int K = sc.nextInt();
		List<Long> HP = new ArrayList<>();

		for(int i=0; i<N; i++) {
			HP.add(sc.nextLong());
		}
		Collections.sort(HP);
		Collections.reverse(HP);
		
		if(N<K) {
			System.out.println(0);
			return;
		}
		long answer = 0;
		
		for(int i=K; i<N; i++) {
			answer += HP.get(i);
		}
		System.out.println(answer);
	} 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 List<Long> HP = new ArrayList<>(); HP new ArrayList<>() for(int i=0; i<N; i++) {
			HP.add(sc.nextLong());
		} int i=0; int i=0; i 0 i<N i N i++ i++ i {
			HP.add(sc.nextLong());
		} {
			HP.add(sc.nextLong());
		} HP.add(sc.nextLong()) HP.add HP sc.nextLong() sc.nextLong sc Collections.sort(HP) Collections.sort Collections HP Collections.reverse(HP) Collections.reverse Collections HP 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; long answer = 0; answer 0 for(int i=K; i<N; i++) {
			answer += HP.get(i);
		} int i=K; int i=K; i K i<N i N i++ i++ i {
			answer += HP.get(i);
		} {
			answer += HP.get(i);
		} answer += HP.get(i) answer HP.get(i) HP.get HP i System.out.println(answer) System.out.println System.out System System.out answer 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();
		List<Long> HP = new ArrayList<>();

		for(int i=0; i<N; i++) {
			HP.add(sc.nextLong());
		}
		Collections.sort(HP);
		Collections.reverse(HP);
		
		if(N<K) {
			System.out.println(0);
			return;
		}
		long answer = 0;
		
		for(int i=K; i<N; i++) {
			answer += HP.get(i);
		}
		System.out.println(answer);
	}		
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int K = sc.nextInt();
		List<Long> HP = new ArrayList<>();

		for(int i=0; i<N; i++) {
			HP.add(sc.nextLong());
		}
		Collections.sort(HP);
		Collections.reverse(HP);
		
		if(N<K) {
			System.out.println(0);
			return;
		}
		long answer = 0;
		
		for(int i=K; i<N; i++) {
			answer += HP.get(i);
		}
		System.out.println(answer);
	}		
} Main
import 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();
		List<Long> HP = new ArrayList<>();

		for(int i=0; i<N; i++) {
			HP.add(sc.nextLong());
		}
		Collections.sort(HP);
		Collections.reverse(HP);
		
		if(N<K) {
			System.out.println(0);
			return;
		}
		long answer = 0;
		
		for(int i=K; i<N; i++) {
			answer += HP.get(i);
		}
		System.out.println(answer);
	}		
}