# 2020/01/26

# AtCoder Beginner Contest 153 - C



# Input

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

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



# Sort Desc.

h.sort()

h.reverse()



if k >= n:

    ans = 0

else:

    sum = 0

    for i in range(k, n):

        sum = sum + h[i]

    

    ans = sum



# Output

print(ans)

# 2020/07/26

# AtCoder Beginner Contest 153 - C



# Input

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

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



# 降順にソート

h.sort()

h.reverse()

ans = 0



for i in range(n):

    # K回まで必殺技を使う

    if i < k:

        continue

    else:

        ans = ans + h[i]



# Output

print(ans)

# 2020/01/26
# AtCoder Beginner Contest 153 - C
# Input
n, k = list(map(int, input().split()))
h = list(map(int, input().split()))
# Sort Desc.
h.sort()
h.reverse()
if k >= n:
    ans = 0
else:
    sum = 0
    for i in range(k, n):
        sum = sum + h[i]
    ans = sum
# Output
print(ans)

# 2020/07/26
# AtCoder Beginner Contest 153 - C
# Input
n, k = list(map(int, input().split()))
h = list(map(int, input().split()))
# 降順にソート
h.sort()
h.reverse()
ans = 0
for i in range(n):
    # K回まで必殺技を使う
    if i < k:
        continue
    else:
        ans = ans + h[i]
# Output
print(ans)

-# 2020/01/26 +# 2020/07/26 -# Sort Desc. +# 降順にソート -if k >= n: -    ans = 0 -else: -    sum = 0 -    for i in range(k, n): -        sum = sum + h[i] -    ans = sum +ans = 0 +for i in range(n): +    # K回まで必殺技を使う +    if i < k: +        continue +    else: +        ans = ans + h[i]