import java.util.*;
import java.lang.Math;

public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
  		
      	int n = sc.nextInt();
      	int k = sc.nextInt();
      	int hs[] = new int[n];
      	long sum = 0;
      
      	for(int i = 0;i < n;i++) hs[i] = sc.nextInt();        
        Arrays.sort(hs);
      	
      	for(int i = 0;i < n-k;i++) sum += hs[i];     	
      	
      	System.out.println(sum);
        
	}
} import java.util.*; util.* java import java.lang.Math; Math java.lang public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
  		
      	int n = sc.nextInt();
      	int k = sc.nextInt();
      	int hs[] = new int[n];
      	long sum = 0;
      
      	for(int i = 0;i < n;i++) hs[i] = sc.nextInt();        
        Arrays.sort(hs);
      	
      	for(int i = 0;i < n-k;i++) sum += hs[i];     	
      	
      	System.out.println(sum);
        
	}
} Main public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
  		
      	int n = sc.nextInt();
      	int k = sc.nextInt();
      	int hs[] = new int[n];
      	long sum = 0;
      
      	for(int i = 0;i < n;i++) hs[i] = sc.nextInt();        
        Arrays.sort(hs);
      	
      	for(int i = 0;i < n-k;i++) sum += hs[i];     	
      	
      	System.out.println(sum);
        
	} main {
		Scanner sc = new Scanner(System.in);
  		
      	int n = sc.nextInt();
      	int k = sc.nextInt();
      	int hs[] = new int[n];
      	long sum = 0;
      
      	for(int i = 0;i < n;i++) hs[i] = sc.nextInt();        
        Arrays.sort(hs);
      	
      	for(int i = 0;i < n-k;i++) sum += hs[i];     	
      	
      	System.out.println(sum);
        
	} 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 hs[] = new int[n]; hs new int[n] n long sum = 0; sum 0 for(int i = 0;i < n;i++) hs[i] = sc.nextInt(); int i = 0; int i = 0; i 0 i < n i n i++ i++ i hs[i] = sc.nextInt(); hs[i] = sc.nextInt() hs[i] hs i sc.nextInt() sc.nextInt sc Arrays.sort(hs) Arrays.sort Arrays hs for(int i = 0;i < n-k;i++) sum += hs[i]; int i = 0; int i = 0; i 0 i < n-k i n-k n k i++ i++ i sum += hs[i]; sum += hs[i] sum hs[i] hs i System.out.println(sum) System.out.println System.out System System.out sum 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 hs[] = new int[n];
      	long sum = 0;
      
      	for(int i = 0;i < n;i++) hs[i] = sc.nextInt();        
        Arrays.sort(hs);
      	
      	for(int i = 0;i < n-k;i++) sum += hs[i];     	
      	
      	System.out.println(sum);
        
	}
} public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
  		
      	int n = sc.nextInt();
      	int k = sc.nextInt();
      	int hs[] = new int[n];
      	long sum = 0;
      
      	for(int i = 0;i < n;i++) hs[i] = sc.nextInt();        
        Arrays.sort(hs);
      	
      	for(int i = 0;i < n-k;i++) sum += hs[i];     	
      	
      	System.out.println(sum);
        
	}
} Main
import java.util.*;
import java.lang.Math;

public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
  		
      	int n = sc.nextInt();
      	int k = sc.nextInt();
      	int hs[] = new int[n];
      	long sum = 0;
      
      	for(int i = 0;i < n;i++) hs[i] = sc.nextInt();        
        Arrays.sort(hs);
      	
      	for(int i = 0;i < n-k;i++) sum += hs[i];     	
      	
      	System.out.println(sum);
        
	}
}
