#template

from collections import Counter

def inputlist(): return [int(j) for j in input().split()]

N,K = inputlist()

H = inputlist()

H.sort()

H.reverse()

ans = 0

for i in range(K,N):

    ans += H[i]

print(ans)
#template

def inputlist(): return [int(k) for k in input().split()]

#template

N,K = inputlist()

H = inputlist()

if K >= N:

    print((0))

    exit()

H.sort(reverse=True)

ha = H[K:]

print((sum(ha)))
# template
from collections import Counter


def inputlist():
    return [int(j) for j in input().split()]


N, K = inputlist()
H = inputlist()
H.sort()
H.reverse()
ans = 0
for i in range(K, N):
    ans += H[i]
print(ans)

# template
def inputlist():
    return [int(k) for k in input().split()]


# template
N, K = inputlist()
H = inputlist()
if K >= N:
    print((0))
    exit()
H.sort(reverse=True)
ha = H[K:]
print((sum(ha)))

-from collections import Counter +def inputlist(): +    return [int(k) for k in input().split()] -def inputlist(): -    return [int(j) for j in input().split()] - - +# template -H.sort() -H.reverse() -ans = 0 -for i in range(K, N): -    ans += H[i] -print(ans) +if K >= N: +    print((0)) +    exit() +H.sort(reverse=True) +ha = H[K:] +print((sum(ha)))