
#include <iostream>
#include <cmath>
#include <algorithm>
#include <cstring>
#include <ctime>
#include <cassert>

#define  max_n (int)1e6

using namespace std;

int n, k;
int a[max_n];

int init_prg() {
   scanf("%d%d", &n,&k);
   for (int i = 0; i < n; ++i)
      scanf("%d", &a[i]);
   sort(a,a+n);
   return 0;
}

int main() {

   freopen("a.in","r",stdin);
   freopen("a.out","w",stdout);

   init_prg();

   long long rez = 0;

   for (int i = k; i < n; ++i)
      rez += a[i];

   cout << rez;
   
   return 0;
}
