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();

		ArrayList<Integer> H = new ArrayList<Integer>();

		for(int i=0; i<N; i++){
			H.add(sc.nextInt());
		}
		H.sort(null);;
		int diff = H.size()-K;
		long sum = 0;

		if(diff>0){
			for(int i=0; i<diff; i++){
				sum += H.get(i);
			}
		}


		System.out.println(sum);
    }
} 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();

		ArrayList<Integer> H = new ArrayList<Integer>();

		for(int i=0; i<N; i++){
			H.add(sc.nextInt());
		}
		H.sort(null);;
		int diff = H.size()-K;
		long sum = 0;

		if(diff>0){
			for(int i=0; i<diff; i++){
				sum += H.get(i);
			}
		}


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

		ArrayList<Integer> H = new ArrayList<Integer>();

		for(int i=0; i<N; i++){
			H.add(sc.nextInt());
		}
		H.sort(null);;
		int diff = H.size()-K;
		long sum = 0;

		if(diff>0){
			for(int i=0; i<diff; i++){
				sum += H.get(i);
			}
		}


		System.out.println(sum);
    } main {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int K = sc.nextInt();

		ArrayList<Integer> H = new ArrayList<Integer>();

		for(int i=0; i<N; i++){
			H.add(sc.nextInt());
		}
		H.sort(null);;
		int diff = H.size()-K;
		long sum = 0;

		if(diff>0){
			for(int i=0; i<diff; i++){
				sum += H.get(i);
			}
		}


		System.out.println(sum);
    } 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 ArrayList<Integer> H = new ArrayList<Integer>(); H new ArrayList<Integer>() for(int i=0; i<N; i++){
			H.add(sc.nextInt());
		} int i=0; int i=0; i 0 i<N i N i++ i++ i {
			H.add(sc.nextInt());
		} {
			H.add(sc.nextInt());
		} H.add(sc.nextInt()) H.add H sc.nextInt() sc.nextInt sc H.sort(null) H.sort H null int diff = H.size()-K; diff H.size()-K H.size() H.size H K long sum = 0; sum 0 if(diff>0){
			for(int i=0; i<diff; i++){
				sum += H.get(i);
			}
		} diff>0 diff 0 {
			for(int i=0; i<diff; i++){
				sum += H.get(i);
			}
		} for(int i=0; i<diff; i++){
				sum += H.get(i);
			} int i=0; int i=0; i 0 i<diff i diff i++ i++ i {
				sum += H.get(i);
			} {
				sum += H.get(i);
			} sum += H.get(i) sum H.get(i) H.get H i 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);
		int N = sc.nextInt();
		int K = sc.nextInt();

		ArrayList<Integer> H = new ArrayList<Integer>();

		for(int i=0; i<N; i++){
			H.add(sc.nextInt());
		}
		H.sort(null);;
		int diff = H.size()-K;
		long sum = 0;

		if(diff>0){
			for(int i=0; i<diff; i++){
				sum += H.get(i);
			}
		}


		System.out.println(sum);
    }
} public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int K = sc.nextInt();

		ArrayList<Integer> H = new ArrayList<Integer>();

		for(int i=0; i<N; i++){
			H.add(sc.nextInt());
		}
		H.sort(null);;
		int diff = H.size()-K;
		long sum = 0;

		if(diff>0){
			for(int i=0; i<diff; i++){
				sum += H.get(i);
			}
		}


		System.out.println(sum);
    }
} 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();

		ArrayList<Integer> H = new ArrayList<Integer>();

		for(int i=0; i<N; i++){
			H.add(sc.nextInt());
		}
		H.sort(null);;
		int diff = H.size()-K;
		long sum = 0;

		if(diff>0){
			for(int i=0; i<diff; i++){
				sum += H.get(i);
			}
		}


		System.out.println(sum);
    }
}
