#include                            <iostream>
#include                            <stdio.h>
#include                            <math.h>
#include                            <string.h>
#include                            <time.h>
#include                            <stdlib.h>
#include                            <string>
#include                            <bitset>
#include                            <vector>
#include                            <set>
#include                            <map>
#include                            <queue>
#include                            <algorithm>
#include                            <sstream>
#include                            <stack>
#include                            <iomanip>
#include                            <numeric>
#include							<unordered_map>
using namespace                     std;
#define int                         int64_t
#define baba_shiv                   ios_base::sync_with_stdio(false);cin.tie(NULL);
#define mpii                        map<int,int>
#define pb                          push_back
#define mkp                         make_pair
#define all(x)                      x.begin(),x.end()
#define allr(x)                     x.rbegin(),x.rend()
#define ub(v,x)                     upper_bound(all(v),x)
#define lb(v,x)                     lower_bound(all(v),x)
#define bs(v,x)                     binary_search(all(v),x)
#define gcd(a,b)                    __gcd(a,b)
#define lcm(a,b)                    (a*b)/__gcd(a,b)
#define vi                          vector<int>
#define pii                         pair<int,int>
#define vpii                        vector<pii>
#define vs                          vector<string>
#define ff                          first
#define ss                          second
#define MOD                         1000000007

/***********************************************************************************************************************/
template < typename F, typename S >
ostream& operator << ( ostream& os, const pair< F, S > & p ) {
	return os << "(" << p.first << ", " << p.second << ")";
}

template < typename T >
ostream &operator << ( ostream & os, const vector< T > &v ) {
	os << "{";
	typename vector< T > :: const_iterator it;
	for ( it = v.begin(); it != v.end(); it++ ) {
		if ( it != v.begin() ) os << ", ";
		os << *it;
	}
	return os << "}";
}

template < typename T >
ostream &operator << ( ostream & os, const set< T > &v ) {
	os << "[";
	typename set< T > :: const_iterator it;
	for ( it = v.begin(); it != v.end(); it++ ) {
		if ( it != v.begin() ) os << ", ";
		os << *it;
	}
	return os << "]";
}

template < typename F, typename S >
ostream &operator << ( ostream & os, const map< F, S > &v ) {
	os << "[";
	typename map< F , S >::const_iterator it;
	for ( it = v.begin(); it != v.end(); it++ ) {
		if ( it != v.begin() ) os << ", ";
		os << it -> first << " = " << it -> second ;
	}
	return os << "]";
}

#define deb(x) cerr<< #x << " = " << x << endl;

/***********************************************************************************************************************/
//implementing disjoint set union
const int siz = 1e5 + 5;
vector<int> parent(siz);
vector<int> bulk(siz);
int nodes, edges;
void initialize(int n)
{
	for (int i = 0; i < n; i++)
	{
		parent[i] = i;
		bulk[i] = 1;
	}
}
int root(int node)
{
	if (node == parent[node])
		return node;
	return parent[node] = root(parent[node]);
}
int rootBeta(int node)
{
	while (parent[node] != node)
	{
		parent[node] = parent[parent[node]];
		node = parent[node];
	}
	return node;
}
void union_set(int a, int b) //connecting the two nodes a and b
{
	a = rootBeta(a);
	b = rootBeta(b);
	if (a != b)
	{
		if (bulk[a] < bulk[b])
			swap(a, b);
		parent[b] = a;
		bulk[a] += bulk[b];
	}
}
//implementing kruskals algorithm
//data strutures required to store
pair<int, pii> graph[siz];
int  kruskal()
{
	int x, y, maxcost = 0, cost = 0;

	for (int i = 1; i < edges; i++)
	{
		x = graph[i].second.first;
		y = graph[i].second.second;

		cost = graph[i].first;

		if (root(x) != root(y)) //cycle must not exist
		{
			maxcost = max(maxcost, cost);
			union_set(x, y);
		}
	}
	//cout << mincost << endl;

	return maxcost;
}
signed main()
{
	baba_shiv;
	int n, k;
	cin >> n >> k;
	vi a;
	a.resize(n);
	for (int i = 0; i < n; i++)
	{
		cin >> a[i];
	}
	sort(all(a), greater<int>());
	int ans = 0;
	for (int i = 0; i < n; i++)
	{
		if (i < k)
			continue;
		ans += a[i];
	}
	cout<<ans<<endl;
}

Measured memory_bytes: 3456