# coding: utf-8

# Your code here!



N,K=list(map(int,input().split()))



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



H.sort()



for _ in range(min(K,len(H))):

    H.pop(-1)

    

print((sum(H)))
# coding: utf-8

# Your code here!

N,K=list(map(int,input().split()))



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

H.sort()





print((sum(H[:max(0,N-K)])))

# coding: utf-8
# Your code here!
N, K = list(map(int, input().split()))
H = list(map(int, input().split()))
H.sort()
for _ in range(min(K, len(H))):
    H.pop(-1)
print((sum(H)))

# coding: utf-8
# Your code here!
N, K = list(map(int, input().split()))
H = list(map(int, input().split()))
H.sort()
print((sum(H[: max(0, N - K)])))

-for _ in range(min(K, len(H))): -    H.pop(-1) -print((sum(H))) +print((sum(H[: max(0, N - K)])))