f=lambda:list(map(int,input().split()))

n,k=f()

l=sorted(f())[::-1]

if n>k:

  print((sum(l[k:])))

else:

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

print(([0,sum(sorted(l)[:n-k])][n>k]))
f = lambda: list(map(int, input().split()))
n, k = f()
l = sorted(f())[::-1]
if n > k:
    print((sum(l[k:])))
else:
    print((0))

n, k, *l = list(map(int, open(0).read().split()))
print(([0, sum(sorted(l)[: n - k])][n > k]))

-f = lambda: list(map(int, input().split())) -n, k = f() -l = sorted(f())[::-1] -if n > k: -    print((sum(l[k:]))) -else: -    print((0)) +n, k, *l = list(map(int, open(0).read().split())) +print(([0, sum(sorted(l)[: n - k])][n > k]))