
import java.util.*;
import java.util.Arrays; 
public class Main{
	
	void cal()
	{
		Scanner sc=new Scanner(System.in);
		int N,K;
		N=sc.nextInt();
		K=sc.nextInt();
		
		
		int Health[]=new int[N];
		
		
		for(int i=0;i<N;i++)
		{
			Health[i]=sc.nextInt();				
		}
		
		Arrays.sort(Health);
	     
	    	long  mov=0;
	    	 N=N-K;
	    	 for(int i=0;i<N;i++)
	 		{
	 			mov+=Health[i];
	 				
	 		}
	    	 System.out.println(mov);
	    	 
	     	
		sc.close();
		
	}

public static void main (String args[])
{
	Main obj= new Main();
	obj.cal();

}
}


 import java.util.*; util.* java import java.util.Arrays; Arrays java.util public class Main{
	
	void cal()
	{
		Scanner sc=new Scanner(System.in);
		int N,K;
		N=sc.nextInt();
		K=sc.nextInt();
		
		
		int Health[]=new int[N];
		
		
		for(int i=0;i<N;i++)
		{
			Health[i]=sc.nextInt();				
		}
		
		Arrays.sort(Health);
	     
	    	long  mov=0;
	    	 N=N-K;
	    	 for(int i=0;i<N;i++)
	 		{
	 			mov+=Health[i];
	 				
	 		}
	    	 System.out.println(mov);
	    	 
	     	
		sc.close();
		
	}

public static void main (String args[])
{
	Main obj= new Main();
	obj.cal();

}
} Main void cal()
	{
		Scanner sc=new Scanner(System.in);
		int N,K;
		N=sc.nextInt();
		K=sc.nextInt();
		
		
		int Health[]=new int[N];
		
		
		for(int i=0;i<N;i++)
		{
			Health[i]=sc.nextInt();				
		}
		
		Arrays.sort(Health);
	     
	    	long  mov=0;
	    	 N=N-K;
	    	 for(int i=0;i<N;i++)
	 		{
	 			mov+=Health[i];
	 				
	 		}
	    	 System.out.println(mov);
	    	 
	     	
		sc.close();
		
	} cal {
		Scanner sc=new Scanner(System.in);
		int N,K;
		N=sc.nextInt();
		K=sc.nextInt();
		
		
		int Health[]=new int[N];
		
		
		for(int i=0;i<N;i++)
		{
			Health[i]=sc.nextInt();				
		}
		
		Arrays.sort(Health);
	     
	    	long  mov=0;
	    	 N=N-K;
	    	 for(int i=0;i<N;i++)
	 		{
	 			mov+=Health[i];
	 				
	 		}
	    	 System.out.println(mov);
	    	 
	     	
		sc.close();
		
	} Scanner sc=new Scanner(System.in); sc new Scanner(System.in) int N N K; K N=sc.nextInt() N sc.nextInt() sc.nextInt sc K=sc.nextInt() K sc.nextInt() sc.nextInt sc int Health[]=new int[N]; Health new int[N] N for(int i=0;i<N;i++)
		{
			Health[i]=sc.nextInt();				
		} int i=0; int i=0; i 0 i<N i N i++ i++ i {
			Health[i]=sc.nextInt();				
		} {
			Health[i]=sc.nextInt();				
		} Health[i]=sc.nextInt() Health[i] Health i sc.nextInt() sc.nextInt sc Arrays.sort(Health) Arrays.sort Arrays Health long  mov=0; mov 0 N=N-K N N-K N K for(int i=0;i<N;i++)
	 		{
	 			mov+=Health[i];
	 				
	 		} int i=0; int i=0; i 0 i<N i N i++ i++ i {
	 			mov+=Health[i];
	 				
	 		} {
	 			mov+=Health[i];
	 				
	 		} mov+=Health[i] mov Health[i] Health i System.out.println(mov) System.out.println System.out System System.out mov sc.close() sc.close sc public static void main (String args[])
{
	Main obj= new Main();
	obj.cal();

} main {
	Main obj= new Main();
	obj.cal();

} Main obj= new Main(); obj new Main() obj.cal() obj.cal obj String args[] args public class Main{
	
	void cal()
	{
		Scanner sc=new Scanner(System.in);
		int N,K;
		N=sc.nextInt();
		K=sc.nextInt();
		
		
		int Health[]=new int[N];
		
		
		for(int i=0;i<N;i++)
		{
			Health[i]=sc.nextInt();				
		}
		
		Arrays.sort(Health);
	     
	    	long  mov=0;
	    	 N=N-K;
	    	 for(int i=0;i<N;i++)
	 		{
	 			mov+=Health[i];
	 				
	 		}
	    	 System.out.println(mov);
	    	 
	     	
		sc.close();
		
	}

public static void main (String args[])
{
	Main obj= new Main();
	obj.cal();

}
} public class Main{
	
	void cal()
	{
		Scanner sc=new Scanner(System.in);
		int N,K;
		N=sc.nextInt();
		K=sc.nextInt();
		
		
		int Health[]=new int[N];
		
		
		for(int i=0;i<N;i++)
		{
			Health[i]=sc.nextInt();				
		}
		
		Arrays.sort(Health);
	     
	    	long  mov=0;
	    	 N=N-K;
	    	 for(int i=0;i<N;i++)
	 		{
	 			mov+=Health[i];
	 				
	 		}
	    	 System.out.println(mov);
	    	 
	     	
		sc.close();
		
	}

public static void main (String args[])
{
	Main obj= new Main();
	obj.cal();

}
} Main

import java.util.*;
import java.util.Arrays; 
public class Main{
	
	void cal()
	{
		Scanner sc=new Scanner(System.in);
		int N,K;
		N=sc.nextInt();
		K=sc.nextInt();
		
		
		int Health[]=new int[N];
		
		
		for(int i=0;i<N;i++)
		{
			Health[i]=sc.nextInt();				
		}
		
		Arrays.sort(Health);
	     
	    	long  mov=0;
	    	 N=N-K;
	    	 for(int i=0;i<N;i++)
	 		{
	 			mov+=Health[i];
	 				
	 		}
	    	 System.out.println(mov);
	    	 
	     	
		sc.close();
		
	}

public static void main (String args[])
{
	Main obj= new Main();
	obj.cal();

}
}



