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();
		long[] H = new long[N];
		long ans = 0;
		for(int i = 0;i < N;i++){
			H[i] = sc.nextLong();
		}
		Arrays.sort(H);
		for(int i = 0;i < K;i++){
			H[N - 1 - i] = 0;
			if(N - 1 - i == 0){
				break;
			}
		}
		for(int i = 0;i < N;i++){
			ans += H[i];
		}
		System.out.println(ans);
	}
} 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();
		long[] H = new long[N];
		long ans = 0;
		for(int i = 0;i < N;i++){
			H[i] = sc.nextLong();
		}
		Arrays.sort(H);
		for(int i = 0;i < K;i++){
			H[N - 1 - i] = 0;
			if(N - 1 - i == 0){
				break;
			}
		}
		for(int i = 0;i < N;i++){
			ans += H[i];
		}
		System.out.println(ans);
	}
} Main public static void main(String args[]){
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int K = sc.nextInt();
		long[] H = new long[N];
		long ans = 0;
		for(int i = 0;i < N;i++){
			H[i] = sc.nextLong();
		}
		Arrays.sort(H);
		for(int i = 0;i < K;i++){
			H[N - 1 - i] = 0;
			if(N - 1 - i == 0){
				break;
			}
		}
		for(int i = 0;i < N;i++){
			ans += H[i];
		}
		System.out.println(ans);
	} main {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int K = sc.nextInt();
		long[] H = new long[N];
		long ans = 0;
		for(int i = 0;i < N;i++){
			H[i] = sc.nextLong();
		}
		Arrays.sort(H);
		for(int i = 0;i < K;i++){
			H[N - 1 - i] = 0;
			if(N - 1 - i == 0){
				break;
			}
		}
		for(int i = 0;i < N;i++){
			ans += H[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[] H = new long[N]; H new long[N] N long ans = 0; ans 0 for(int i = 0;i < N;i++){
			H[i] = sc.nextLong();
		} int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
			H[i] = sc.nextLong();
		} {
			H[i] = sc.nextLong();
		} H[i] = sc.nextLong() H[i] H i sc.nextLong() sc.nextLong sc Arrays.sort(H) Arrays.sort Arrays H for(int i = 0;i < K;i++){
			H[N - 1 - i] = 0;
			if(N - 1 - i == 0){
				break;
			}
		} int i = 0; int i = 0; i 0 i < K i K i++ i++ i {
			H[N - 1 - i] = 0;
			if(N - 1 - i == 0){
				break;
			}
		} {
			H[N - 1 - i] = 0;
			if(N - 1 - i == 0){
				break;
			}
		} H[N - 1 - i] = 0 H[N - 1 - i] H N - 1 - i N - 1 - i N 1 i 0 if(N - 1 - i == 0){
				break;
			} N - 1 - i == 0 N - 1 - i N - 1 - i N 1 i 0 {
				break;
			} break; for(int i = 0;i < N;i++){
			ans += H[i];
		} int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
			ans += H[i];
		} {
			ans += H[i];
		} ans += H[i] ans H[i] H 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[]){
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int K = sc.nextInt();
		long[] H = new long[N];
		long ans = 0;
		for(int i = 0;i < N;i++){
			H[i] = sc.nextLong();
		}
		Arrays.sort(H);
		for(int i = 0;i < K;i++){
			H[N - 1 - i] = 0;
			if(N - 1 - i == 0){
				break;
			}
		}
		for(int i = 0;i < N;i++){
			ans += H[i];
		}
		System.out.println(ans);
	}
} public class Main{
	public static void main(String args[]){
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int K = sc.nextInt();
		long[] H = new long[N];
		long ans = 0;
		for(int i = 0;i < N;i++){
			H[i] = sc.nextLong();
		}
		Arrays.sort(H);
		for(int i = 0;i < K;i++){
			H[N - 1 - i] = 0;
			if(N - 1 - i == 0){
				break;
			}
		}
		for(int i = 0;i < N;i++){
			ans += H[i];
		}
		System.out.println(ans);
	}
} 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();
		long[] H = new long[N];
		long ans = 0;
		for(int i = 0;i < N;i++){
			H[i] = sc.nextLong();
		}
		Arrays.sort(H);
		for(int i = 0;i < K;i++){
			H[N - 1 - i] = 0;
			if(N - 1 - i == 0){
				break;
			}
		}
		for(int i = 0;i < N;i++){
			ans += H[i];
		}
		System.out.println(ans);
	}
}