#include <iostream>
#include <bits/stdc++.h>
using namespace std;
int main(){
    vector <long long> v;
    long long ans=0;
    int n,k,y; cin>> n>>k;
    y=n;
    while (y--){
        long long x; cin>>x;
        v.push_back(x);
    }
    if (k>=n)
        cout<<0;
    else {
    sort (v.begin(), v.end());
    while (k--){
        n-=1;
        v[n]=0;
    }
    for (int i=0; i<v.size(); i++)
        ans+=v[i];
    cout<< ans;
    }
         return 0;
}