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

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



list_score.sort()



if h >= len(list_score):

    h = len(list_score)



for i in range(h):

    list_score.pop(-1)



ans = sum(list_score)



print(ans)
n, h = list(map(int, input().split()))

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



list_score.sort()

if h > n:

    print((0))

else:

    ans = sum(list_score[:n-h])

    print(ans)
n, h = list(map(int, input().split()))
list_score = list(map(int, input().split()))
list_score.sort()
if h >= len(list_score):
    h = len(list_score)
for i in range(h):
    list_score.pop(-1)
ans = sum(list_score)
print(ans)

n, h = list(map(int, input().split()))
list_score = list(map(int, input().split()))
list_score.sort()
if h > n:
    print((0))
else:
    ans = sum(list_score[: n - h])
    print(ans)

-if h >= len(list_score): -    h = len(list_score) -for i in range(h): -    list_score.pop(-1) -ans = sum(list_score) -print(ans) +if h > n: +    print((0)) +else: +    ans = sum(list_score[: n - h]) +    print(ans)