
import java.io.FileReader;
import java.io.FileWriter;
import java.io.PrintWriter;
import java.util.*;
class Main{
 static int a[]= new int[100001];
 static long sum=0;
	public static void main(String [] args){
		try {
		Scanner sc= new Scanner(new FileReader("A.in"));
			int N= sc.nextInt();
			int K=sc.nextInt();
			for (int i=0; i<N;i++)
			a[i]= sc.nextInt();
			
			quick_sort(a,0,N-1);
long r=N-K;
			for (int i=0; i<r;i++)
				sum+=a[i];
			sc.close();
	PrintWriter out = new PrintWriter (new FileWriter ("A.out"));
	out.println(sum);
	out.close();
	} catch (Exception e){}
	}

static void quick_sort(int []a, int L, int R){
int p= a[(L+R)/2];
int i = L; int j=  R;
do{
while(a[i]>p) i++;
while(a[j]<p) j--;
 if(i<=j){
  int temp= a[i];
   a[i]=a[j];
   a[j]=temp;
   i++; j--;}}
while(i<=j);
if(j>=L)  quick_sort(a,L,j);
if(i<=R)  quick_sort(a,i,R);
}
}