#include <cstdio>
#include <iostream>

using namespace std;
int a[1000000];
int main()
{
freopen("A.in","r",stdin);
freopen("A.out","w",stdout);
int n,m;
cin>>n;
cin>>m;
for (int i=0;i<n;i++)
{
cin>>a[i];
}
sort(a,a+n);
reverse(a,a+n);
int s=0;
for (int i=0;i<n-m;i++)
{
s+=a[i];
}
cout<<s;
return 0;
}