#include <iostream>
#include <algorithm>

using namespace std;

#define PROBLEM "A"

#define MAXN 1000000

int a[MAXN];

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