import sys



sr = lambda: sys.stdin.readline().rstrip()

ir = lambda: int(sr())

lr = lambda: list(map(int, sr().split()))



N, K = lr()

H = lr()

H.sort(reverse=True)

answer = sum(H[K:])

print(answer)

# coding: utf-8

import sys



sr = lambda: sys.stdin.readline().rstrip()

ir = lambda: int(sr())

lr = lambda: list(map(int, sr().split()))



N, K = lr()

H = lr()

H.sort(reverse=True)

H = H[K:]

answer = sum(H)

print(answer)

import sys

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))
N, K = lr()
H = lr()
H.sort(reverse=True)
answer = sum(H[K:])
print(answer)

# coding: utf-8
import sys

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))
N, K = lr()
H = lr()
H.sort(reverse=True)
H = H[K:]
answer = sum(H)
print(answer)

+# coding: utf-8 -answer = sum(H[K:]) +H = H[K:] +answer = sum(H)