# -*- coding:utf-8 -*-

n,k = list(map(int, input().split()))

h = []

count = 0



for i in map(int, input().split()):

  h.append(i)



hr = sorted(h, reverse=True)



for l in range(n):

  if l >= k:

    count += hr[l]

print(count)

    
n,k = list(map(int, input().split()))

h = list(map(int, input().split()))



h = sorted(h, reverse = True)



for i in range(k):

  if i == n:

    break

  h[i] = 0



a = 0

for i in h:

  a += i

print(a)
# -*- coding:utf-8 -*-
n, k = list(map(int, input().split()))
h = []
count = 0
for i in map(int, input().split()):
    h.append(i)
hr = sorted(h, reverse=True)
for l in range(n):
    if l >= k:
        count += hr[l]
print(count)

n, k = list(map(int, input().split()))
h = list(map(int, input().split()))
h = sorted(h, reverse=True)
for i in range(k):
    if i == n:
        break
    h[i] = 0
a = 0
for i in h:
    a += i
print(a)

-# -*- coding:utf-8 -*- -h = [] -count = 0 -for i in map(int, input().split()): -    h.append(i) -hr = sorted(h, reverse=True) -for l in range(n): -    if l >= k: -        count += hr[l] -print(count) +h = list(map(int, input().split())) +h = sorted(h, reverse=True) +for i in range(k): +    if i == n: +        break +    h[i] = 0 +a = 0 +for i in h: +    a += i +print(a)