import java.util.*;
public class Main{
	public static void main(String[] args) {
    	Scanner scan = new Scanner(System.in);
      	int n = scan.nextInt();
      	int t = scan.nextInt();
		int [] ar = new int[n + 1];
      	for (int i = 1 ; i <= n ; i++)
        	ar[i] = scan.nextInt();
      	Arrays.sort(ar);
      	long ans = 0;
      	for (int i = 1 ; i <= Math.max(0,n-t) ; i++)
        	ans += ar[i];
      	System.out.println(ans);
    }
} import java.util.*; util.* java public class Main{
	public static void main(String[] args) {
    	Scanner scan = new Scanner(System.in);
      	int n = scan.nextInt();
      	int t = scan.nextInt();
		int [] ar = new int[n + 1];
      	for (int i = 1 ; i <= n ; i++)
        	ar[i] = scan.nextInt();
      	Arrays.sort(ar);
      	long ans = 0;
      	for (int i = 1 ; i <= Math.max(0,n-t) ; i++)
        	ans += ar[i];
      	System.out.println(ans);
    }
} Main public static void main(String[] args) {
    	Scanner scan = new Scanner(System.in);
      	int n = scan.nextInt();
      	int t = scan.nextInt();
		int [] ar = new int[n + 1];
      	for (int i = 1 ; i <= n ; i++)
        	ar[i] = scan.nextInt();
      	Arrays.sort(ar);
      	long ans = 0;
      	for (int i = 1 ; i <= Math.max(0,n-t) ; i++)
        	ans += ar[i];
      	System.out.println(ans);
    } main {
    	Scanner scan = new Scanner(System.in);
      	int n = scan.nextInt();
      	int t = scan.nextInt();
		int [] ar = new int[n + 1];
      	for (int i = 1 ; i <= n ; i++)
        	ar[i] = scan.nextInt();
      	Arrays.sort(ar);
      	long ans = 0;
      	for (int i = 1 ; i <= Math.max(0,n-t) ; i++)
        	ans += ar[i];
      	System.out.println(ans);
    } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int n = scan.nextInt(); n scan.nextInt() scan.nextInt scan int t = scan.nextInt(); t scan.nextInt() scan.nextInt scan int [] ar = new int[n + 1]; ar new int[n + 1] n + 1 n 1 for (int i = 1 ; i <= n ; i++)
        	ar[i] = scan.nextInt(); int i = 1 ; int i = 1 ; i 1 i <= n i n i++ i++ i ar[i] = scan.nextInt(); ar[i] = scan.nextInt() ar[i] ar i scan.nextInt() scan.nextInt scan Arrays.sort(ar) Arrays.sort Arrays ar long ans = 0; ans 0 for (int i = 1 ; i <= Math.max(0,n-t) ; i++)
        	ans += ar[i]; int i = 1 ; int i = 1 ; i 1 i <= Math.max(0,n-t) i Math.max(0,n-t) Math.max Math 0 n-t n t i++ i++ i ans += ar[i]; ans += ar[i] ans ar[i] ar i System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main{
	public static void main(String[] args) {
    	Scanner scan = new Scanner(System.in);
      	int n = scan.nextInt();
      	int t = scan.nextInt();
		int [] ar = new int[n + 1];
      	for (int i = 1 ; i <= n ; i++)
        	ar[i] = scan.nextInt();
      	Arrays.sort(ar);
      	long ans = 0;
      	for (int i = 1 ; i <= Math.max(0,n-t) ; i++)
        	ans += ar[i];
      	System.out.println(ans);
    }
} public class Main{
	public static void main(String[] args) {
    	Scanner scan = new Scanner(System.in);
      	int n = scan.nextInt();
      	int t = scan.nextInt();
		int [] ar = new int[n + 1];
      	for (int i = 1 ; i <= n ; i++)
        	ar[i] = scan.nextInt();
      	Arrays.sort(ar);
      	long ans = 0;
      	for (int i = 1 ; i <= Math.max(0,n-t) ; i++)
        	ans += ar[i];
      	System.out.println(ans);
    }
} Main
import java.util.*;
public class Main{
	public static void main(String[] args) {
    	Scanner scan = new Scanner(System.in);
      	int n = scan.nextInt();
      	int t = scan.nextInt();
		int [] ar = new int[n + 1];
      	for (int i = 1 ; i <= n ; i++)
        	ar[i] = scan.nextInt();
      	Arrays.sort(ar);
      	long ans = 0;
      	for (int i = 1 ; i <= Math.max(0,n-t) ; i++)
        	ans += ar[i];
      	System.out.println(ans);
    }
}