#include <iostream>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <vector>
#include <map>

#define PROB "A"

using namespace std;

int main() {
  freopen(PROB".in", "r", stdin);
  freopen(PROB".out", "w", stdout);
  int i,n,k,p;
  long long t;
  vector <int> w;
  cin >> n >> k;
  for(i=0;i<n;i++) {
    cin >> p;
    w.push_back(p);
  }
  if(n <= k) {
    t = 0;
  }
  else {
    sort(w.begin(),w.end());
    t = 0;
    for(i=k;i<n;i++) {
      t += (long long)w[i];
    }
  }
  cout << t;
  return 0;
}
