import std;

alias sread = () => readln.chomp();
alias lread = () => readln.chomp.to!long();
alias aryread(T = long) = () => readln.split.to!(T[]);
//aryread!string();
void main()
{
    long n, k;
    scan(n, k);
    auto h = aryread();
    auto h_so = sort(h);
    // writeln(h_so);
    if (h.length <= k)
    {
        writeln(0);
        return;
    }
    if (k == 0)
    {
        writeln(sum(h));
        return;
    }
    foreach (i; 0 .. k)
    {
        h_so[(n - 1) - i] = 0;
    }
    writeln(sum(h_so));

}

void scan(L...)(ref L A)
{
    auto l = readln.split;
    foreach (i, T; L)
    {
        A[i] = l[i].to!T;
    }
}

void arywrite(T)(T a)
{
    a.map!text.join(' ').writeln;
}
