#include <iostream>
#include <cstdio>


using namespace std;

int a[1000005];

void Sort(int l,int r) 
	{
	  int i=l; int j=r;
	   int x=a[(i+j)/2];
	   do 
	   {
		 while (x>a[i]) i++;
		 while (x<a[j]) j--;
		  if (i<=j) 
		  {
			int t=a[i];
			a[i]=a[j]; a[j]=t;
			i++; j--;
		  }
		   
		   
	   }while(i<j);
	   if (i<r) Sort(i,r);
	   if (j>l) Sort(l,j);
	}

int main()
{
freopen("A.in","r",stdin);
freopen("A.out","w",stdout);
int n,m,i;
scanf("%d%d",&n,&m);
 for (i=0;i<n;i++) 
 scanf("%d",&a[i]);
Sort(0,n-1);
long long s=0;
 for (i=m;i<n;i++)
   s+=a[i];
cout<<s;
return 0;
}
