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

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



count = 0

if k<n:

  num = sorted(num)

  num = num[::-1]

  for i in range(k,n):

    count = count + num[i]

  print(count)

  exit()

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

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

h = sorted(h)

h = h[::-1]

if k>=n:

  print((0))

else:

  print((sum(h[k:n])))

n, k = list(map(int, input().split()))
num = list(map(int, input().split()))
count = 0
if k < n:
    num = sorted(num)
    num = num[::-1]
    for i in range(k, n):
        count = count + num[i]
    print(count)
    exit()
print(count)

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

-num = list(map(int, input().split())) -count = 0 -if k < n: -    num = sorted(num) -    num = num[::-1] -    for i in range(k, n): -        count = count + num[i] -    print(count) -    exit() -print(count) +h = list(map(int, input().split())) +h = sorted(h) +h = h[::-1] +if k >= n: +    print((0)) +else: +    print((sum(h[k:n])))