import java.util.*;

public class Main{
  public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long N = sc.nextLong();
		long K = sc.nextLong();
		long attack = 0;
		long[] num = new long[(int) N];
		for(int i = 0;i < N;i++) {
			num[i] = sc.nextInt();
		}
		if(N <= K) {
			System.out.println("0");
		}else {
			Arrays.sort(num);
			for(int j = 1;j <= K;j++) {
				num[(int) (N-j)] = 0;
			}
			for(int k = 0;k < N;k++) {
				attack += num[k];
			}
			System.out.println(attack);
		}
	}
} import java.util.*; util.* java public class Main{
  public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long N = sc.nextLong();
		long K = sc.nextLong();
		long attack = 0;
		long[] num = new long[(int) N];
		for(int i = 0;i < N;i++) {
			num[i] = sc.nextInt();
		}
		if(N <= K) {
			System.out.println("0");
		}else {
			Arrays.sort(num);
			for(int j = 1;j <= K;j++) {
				num[(int) (N-j)] = 0;
			}
			for(int k = 0;k < N;k++) {
				attack += num[k];
			}
			System.out.println(attack);
		}
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long N = sc.nextLong();
		long K = sc.nextLong();
		long attack = 0;
		long[] num = new long[(int) N];
		for(int i = 0;i < N;i++) {
			num[i] = sc.nextInt();
		}
		if(N <= K) {
			System.out.println("0");
		}else {
			Arrays.sort(num);
			for(int j = 1;j <= K;j++) {
				num[(int) (N-j)] = 0;
			}
			for(int k = 0;k < N;k++) {
				attack += num[k];
			}
			System.out.println(attack);
		}
	} main {
		Scanner sc = new Scanner(System.in);
		long N = sc.nextLong();
		long K = sc.nextLong();
		long attack = 0;
		long[] num = new long[(int) N];
		for(int i = 0;i < N;i++) {
			num[i] = sc.nextInt();
		}
		if(N <= K) {
			System.out.println("0");
		}else {
			Arrays.sort(num);
			for(int j = 1;j <= K;j++) {
				num[(int) (N-j)] = 0;
			}
			for(int k = 0;k < N;k++) {
				attack += num[k];
			}
			System.out.println(attack);
		}
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) long N = sc.nextLong(); N sc.nextLong() sc.nextLong sc long K = sc.nextLong(); K sc.nextLong() sc.nextLong sc long attack = 0; attack 0 long[] num = new long[(int) N]; num new long[(int) N] (int) N for(int i = 0;i < N;i++) {
			num[i] = sc.nextInt();
		} int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
			num[i] = sc.nextInt();
		} {
			num[i] = sc.nextInt();
		} num[i] = sc.nextInt() num[i] num i sc.nextInt() sc.nextInt sc if(N <= K) {
			System.out.println("0");
		}else {
			Arrays.sort(num);
			for(int j = 1;j <= K;j++) {
				num[(int) (N-j)] = 0;
			}
			for(int k = 0;k < N;k++) {
				attack += num[k];
			}
			System.out.println(attack);
		} N <= K N K {
			System.out.println("0");
		} System.out.println("0") System.out.println System.out System System.out "0" {
			Arrays.sort(num);
			for(int j = 1;j <= K;j++) {
				num[(int) (N-j)] = 0;
			}
			for(int k = 0;k < N;k++) {
				attack += num[k];
			}
			System.out.println(attack);
		} Arrays.sort(num) Arrays.sort Arrays num for(int j = 1;j <= K;j++) {
				num[(int) (N-j)] = 0;
			} int j = 1; int j = 1; j 1 j <= K j K j++ j++ j {
				num[(int) (N-j)] = 0;
			} {
				num[(int) (N-j)] = 0;
			} num[(int) (N-j)] = 0 num[(int) (N-j)] num (int) (N-j) N j 0 for(int k = 0;k < N;k++) {
				attack += num[k];
			} int k = 0; int k = 0; k 0 k < N k N k++ k++ k {
				attack += num[k];
			} {
				attack += num[k];
			} attack += num[k] attack num[k] num k System.out.println(attack) System.out.println System.out System System.out attack String[] args args public class Main{
  public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long N = sc.nextLong();
		long K = sc.nextLong();
		long attack = 0;
		long[] num = new long[(int) N];
		for(int i = 0;i < N;i++) {
			num[i] = sc.nextInt();
		}
		if(N <= K) {
			System.out.println("0");
		}else {
			Arrays.sort(num);
			for(int j = 1;j <= K;j++) {
				num[(int) (N-j)] = 0;
			}
			for(int k = 0;k < N;k++) {
				attack += num[k];
			}
			System.out.println(attack);
		}
	}
} public class Main{
  public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long N = sc.nextLong();
		long K = sc.nextLong();
		long attack = 0;
		long[] num = new long[(int) N];
		for(int i = 0;i < N;i++) {
			num[i] = sc.nextInt();
		}
		if(N <= K) {
			System.out.println("0");
		}else {
			Arrays.sort(num);
			for(int j = 1;j <= K;j++) {
				num[(int) (N-j)] = 0;
			}
			for(int k = 0;k < N;k++) {
				attack += num[k];
			}
			System.out.println(attack);
		}
	}
} Main
import java.util.*;

public class Main{
  public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long N = sc.nextLong();
		long K = sc.nextLong();
		long attack = 0;
		long[] num = new long[(int) N];
		for(int i = 0;i < N;i++) {
			num[i] = sc.nextInt();
		}
		if(N <= K) {
			System.out.println("0");
		}else {
			Arrays.sort(num);
			for(int j = 1;j <= K;j++) {
				num[(int) (N-j)] = 0;
			}
			for(int k = 0;k < N;k++) {
				attack += num[k];
			}
			System.out.println(attack);
		}
	}
}