import java.util.Arrays;
import java.util.Scanner;

public class Main{
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int k = scan.nextInt();

		int[] h = new int[n];

		int i;
		for(i = 0; i < n; i++) {
			h[i] = scan.nextInt();
		}

		Arrays.sort(h);

		if(k >= n) {
			System.out.println(0);
			return;
		}else {
			long sum = 0;
			for(i = 0; i < n - k; i++) {
				sum += h[i];
			}
			System.out.println(sum);
			return;
		}

	}
} import java.util.Arrays; Arrays java.util import java.util.Scanner; Scanner java.util public class Main{
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int k = scan.nextInt();

		int[] h = new int[n];

		int i;
		for(i = 0; i < n; i++) {
			h[i] = scan.nextInt();
		}

		Arrays.sort(h);

		if(k >= n) {
			System.out.println(0);
			return;
		}else {
			long sum = 0;
			for(i = 0; i < n - k; i++) {
				sum += h[i];
			}
			System.out.println(sum);
			return;
		}

	}
} Main public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int k = scan.nextInt();

		int[] h = new int[n];

		int i;
		for(i = 0; i < n; i++) {
			h[i] = scan.nextInt();
		}

		Arrays.sort(h);

		if(k >= n) {
			System.out.println(0);
			return;
		}else {
			long sum = 0;
			for(i = 0; i < n - k; i++) {
				sum += h[i];
			}
			System.out.println(sum);
			return;
		}

	} main {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int k = scan.nextInt();

		int[] h = new int[n];

		int i;
		for(i = 0; i < n; i++) {
			h[i] = scan.nextInt();
		}

		Arrays.sort(h);

		if(k >= n) {
			System.out.println(0);
			return;
		}else {
			long sum = 0;
			for(i = 0; i < n - k; i++) {
				sum += h[i];
			}
			System.out.println(sum);
			return;
		}

	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int n = scan.nextInt(); n scan.nextInt() scan.nextInt scan int k = scan.nextInt(); k scan.nextInt() scan.nextInt scan int[] h = new int[n]; h new int[n] n int i; i for(i = 0; i < n; i++) {
			h[i] = scan.nextInt();
		} i = 0; i = 0 i 0 i < n i n i++ i++ i {
			h[i] = scan.nextInt();
		} {
			h[i] = scan.nextInt();
		} h[i] = scan.nextInt() h[i] h i scan.nextInt() scan.nextInt scan Arrays.sort(h) Arrays.sort Arrays h if(k >= n) {
			System.out.println(0);
			return;
		}else {
			long sum = 0;
			for(i = 0; i < n - k; i++) {
				sum += h[i];
			}
			System.out.println(sum);
			return;
		} k >= n k n {
			System.out.println(0);
			return;
		} System.out.println(0) System.out.println System.out System System.out 0 return; {
			long sum = 0;
			for(i = 0; i < n - k; i++) {
				sum += h[i];
			}
			System.out.println(sum);
			return;
		} long sum = 0; sum 0 for(i = 0; i < n - k; i++) {
				sum += h[i];
			} i = 0; i = 0 i 0 i < n - k i n - k n k 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 return; String[] args args public class Main{
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int k = scan.nextInt();

		int[] h = new int[n];

		int i;
		for(i = 0; i < n; i++) {
			h[i] = scan.nextInt();
		}

		Arrays.sort(h);

		if(k >= n) {
			System.out.println(0);
			return;
		}else {
			long sum = 0;
			for(i = 0; i < n - k; i++) {
				sum += h[i];
			}
			System.out.println(sum);
			return;
		}

	}
} public class Main{
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int k = scan.nextInt();

		int[] h = new int[n];

		int i;
		for(i = 0; i < n; i++) {
			h[i] = scan.nextInt();
		}

		Arrays.sort(h);

		if(k >= n) {
			System.out.println(0);
			return;
		}else {
			long sum = 0;
			for(i = 0; i < n - k; i++) {
				sum += h[i];
			}
			System.out.println(sum);
			return;
		}

	}
} Main
import java.util.Arrays;
import java.util.Scanner;

public class Main{
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int k = scan.nextInt();

		int[] h = new int[n];

		int i;
		for(i = 0; i < n; i++) {
			h[i] = scan.nextInt();
		}

		Arrays.sort(h);

		if(k >= n) {
			System.out.println(0);
			return;
		}else {
			long sum = 0;
			for(i = 0; i < n - k; i++) {
				sum += h[i];
			}
			System.out.println(sum);
			return;
		}

	}
}