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



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



# print(h)





new_h=h[0:max(n-k,0)]

# print(new_h)



print((sum(new_h)))

n,k,*h=list(map(int,open(0).read().split()))

if k>=n:

  print((0))

  exit()

h.sort(reverse=True)

for i in range(k):

  h[i]=0

print((sum(h)))
n, k = list(map(int, input().split()))
h = sorted(list(map(int, input().split())))
# print(h)
new_h = h[0 : max(n - k, 0)]
# print(new_h)
print((sum(new_h)))

n, k, *h = list(map(int, open(0).read().split()))
if k >= n:
    print((0))
    exit()
h.sort(reverse=True)
for i in range(k):
    h[i] = 0
print((sum(h)))

-n, k = list(map(int, input().split())) -h = sorted(list(map(int, input().split()))) -# print(h) -new_h = h[0 : max(n - k, 0)] -# print(new_h) -print((sum(new_h))) +n, k, *h = list(map(int, open(0).read().split())) +if k >= n: +    print((0)) +    exit() +h.sort(reverse=True) +for i in range(k): +    h[i] = 0 +print((sum(h)))