import java.io.*;
import java.util.*;

public class Main {

	final static long MOD = 1000000007;
	public static void main(String[] args) throws Exception {
		// TODO 自動生成されたメソッド・スタブ

		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		String W = in.readLine();
		String[] Ws = W.split(" ");
		int N = Integer.parseInt(Ws[0]);
		int K = Integer.parseInt(Ws[1]);

		W = in.readLine();
		Ws = W.split(" ");

		long[] H = new long[Ws.length];
		for (int i = 0; i < Ws.length; i++) {
			H[i] = Long.parseLong(Ws[i]);
		}

		Arrays.sort(H);
		long sum=0;
		for(int i=N-1-K;i>=0;i--){
			sum+=H[i];
		}

		System.out.println(sum);
	}
} import java.io.*; io.* java import java.util.*; util.* java public class Main {

	final static long MOD = 1000000007;
	public static void main(String[] args) throws Exception {
		// TODO 自動生成されたメソッド・スタブ

		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		String W = in.readLine();
		String[] Ws = W.split(" ");
		int N = Integer.parseInt(Ws[0]);
		int K = Integer.parseInt(Ws[1]);

		W = in.readLine();
		Ws = W.split(" ");

		long[] H = new long[Ws.length];
		for (int i = 0; i < Ws.length; i++) {
			H[i] = Long.parseLong(Ws[i]);
		}

		Arrays.sort(H);
		long sum=0;
		for(int i=N-1-K;i>=0;i--){
			sum+=H[i];
		}

		System.out.println(sum);
	}
} Main final static long MOD = 1000000007; MOD 1000000007 public static void main(String[] args) throws Exception {
		// TODO 自動生成されたメソッド・スタブ

		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		String W = in.readLine();
		String[] Ws = W.split(" ");
		int N = Integer.parseInt(Ws[0]);
		int K = Integer.parseInt(Ws[1]);

		W = in.readLine();
		Ws = W.split(" ");

		long[] H = new long[Ws.length];
		for (int i = 0; i < Ws.length; i++) {
			H[i] = Long.parseLong(Ws[i]);
		}

		Arrays.sort(H);
		long sum=0;
		for(int i=N-1-K;i>=0;i--){
			sum+=H[i];
		}

		System.out.println(sum);
	} main {
		// TODO 自動生成されたメソッド・スタブ

		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		String W = in.readLine();
		String[] Ws = W.split(" ");
		int N = Integer.parseInt(Ws[0]);
		int K = Integer.parseInt(Ws[1]);

		W = in.readLine();
		Ws = W.split(" ");

		long[] H = new long[Ws.length];
		for (int i = 0; i < Ws.length; i++) {
			H[i] = Long.parseLong(Ws[i]);
		}

		Arrays.sort(H);
		long sum=0;
		for(int i=N-1-K;i>=0;i--){
			sum+=H[i];
		}

		System.out.println(sum);
	} BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); in new BufferedReader(new InputStreamReader(System.in)) String W = in.readLine(); W in.readLine() in.readLine in String[] Ws = W.split(" "); Ws W.split(" ") W.split W " " int N = Integer.parseInt(Ws[0]); N Integer.parseInt(Ws[0]) Integer.parseInt Integer Ws[0] Ws 0 int K = Integer.parseInt(Ws[1]); K Integer.parseInt(Ws[1]) Integer.parseInt Integer Ws[1] Ws 1 W = in.readLine() W in.readLine() in.readLine in Ws = W.split(" ") Ws W.split(" ") W.split W " " long[] H = new long[Ws.length]; H new long[Ws.length] Ws.length Ws Ws.length for (int i = 0; i < Ws.length; i++) {
			H[i] = Long.parseLong(Ws[i]);
		} int i = 0; int i = 0; i 0 i < Ws.length i Ws.length Ws Ws.length i++ i++ i {
			H[i] = Long.parseLong(Ws[i]);
		} {
			H[i] = Long.parseLong(Ws[i]);
		} H[i] = Long.parseLong(Ws[i]) H[i] H i Long.parseLong(Ws[i]) Long.parseLong Long Ws[i] Ws i Arrays.sort(H) Arrays.sort Arrays H long sum=0; sum 0 for(int i=N-1-K;i>=0;i--){
			sum+=H[i];
		} int i=N-1-K; int i=N-1-K; i N-1-K N-1-K N 1 K i>=0 i 0 i-- i-- i {
			sum+=H[i];
		} {
			sum+=H[i];
		} sum+=H[i] sum H[i] H i System.out.println(sum) System.out.println System.out System System.out sum String[] args args public class Main {

	final static long MOD = 1000000007;
	public static void main(String[] args) throws Exception {
		// TODO 自動生成されたメソッド・スタブ

		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		String W = in.readLine();
		String[] Ws = W.split(" ");
		int N = Integer.parseInt(Ws[0]);
		int K = Integer.parseInt(Ws[1]);

		W = in.readLine();
		Ws = W.split(" ");

		long[] H = new long[Ws.length];
		for (int i = 0; i < Ws.length; i++) {
			H[i] = Long.parseLong(Ws[i]);
		}

		Arrays.sort(H);
		long sum=0;
		for(int i=N-1-K;i>=0;i--){
			sum+=H[i];
		}

		System.out.println(sum);
	}
} public class Main {

	final static long MOD = 1000000007;
	public static void main(String[] args) throws Exception {
		// TODO 自動生成されたメソッド・スタブ

		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		String W = in.readLine();
		String[] Ws = W.split(" ");
		int N = Integer.parseInt(Ws[0]);
		int K = Integer.parseInt(Ws[1]);

		W = in.readLine();
		Ws = W.split(" ");

		long[] H = new long[Ws.length];
		for (int i = 0; i < Ws.length; i++) {
			H[i] = Long.parseLong(Ws[i]);
		}

		Arrays.sort(H);
		long sum=0;
		for(int i=N-1-K;i>=0;i--){
			sum+=H[i];
		}

		System.out.println(sum);
	}
} Main
import java.io.*;
import java.util.*;

public class Main {

	final static long MOD = 1000000007;
	public static void main(String[] args) throws Exception {
		// TODO 自動生成されたメソッド・スタブ

		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		String W = in.readLine();
		String[] Ws = W.split(" ");
		int N = Integer.parseInt(Ws[0]);
		int K = Integer.parseInt(Ws[1]);

		W = in.readLine();
		Ws = W.split(" ");

		long[] H = new long[Ws.length];
		for (int i = 0; i < Ws.length; i++) {
			H[i] = Long.parseLong(Ws[i]);
		}

		Arrays.sort(H);
		long sum=0;
		for(int i=N-1-K;i>=0;i--){
			sum+=H[i];
		}

		System.out.println(sum);
	}
}
