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