CodeEff/ECCO huggingface dataset:
# Original solution
n, k = list(map(int, input().split()))
s = list(map(int, input().split()))
# s.sort()
if k > len(s):
    k = len(s)
for j in range(1, k+1):
    s[s.index(max(s))] = 0
print((sum(s)))


# Optimized solution
n, k = list(map(int, input().split()))
s = list(map(int, input().split()))
if k > len(s):
    k = len(s)
s = sorted(s, reverse=True)

print((sum(s[k:])))
# Original solution
n, k = list(map(int, input().split()))
h = list(map(int, input().split()))
h2 = sorted(h)

ans = 0
for i in range(n-k):
  ans += h2[0]
  del h2[0]
  
print(ans)

# Optimized solution
n, k = list(map(int, input().split()))
h = list(map(int, input().split()))
h2 = sorted(h)

if n<k:
  print((0))
else:
  print((sum(h2[0:n-k])))
# Original solution
n,k=list(map(int,input().split()))
a=sorted(list(map(int,input().split())),reverse=True)
for i in range(k):
    if a==[]:
        break
    a.remove(a[0])
print((sum(a)))

# Optimized solution
n,k=list(map(int,input().split()))
a=sorted(list(map(int,input().split())),reverse=True)
if k>=len(a):
    print((0))
else:
    print((sum(a[k:])))
# Original solution
import math

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

H.sort(reverse=True)
if K >= N:
    print((0))
else:
    for i in range(K):
        H[i] = 0
    print((sum(H)))


# Optimized solution
H, K = list(map(int, input().split()))
power = list(map(int, input().split()))

power = sorted(power, reverse=True)

print((sum(power[K:])))
# Original solution
from collections import deque

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

deqh = deque(H)

for i in range(k):
    if len(deqh) == 0:
        break
    max_hp = max(deqh)
    deqh.remove(max_hp)

print((sum(deqh)))


# Optimized solution
from collections import deque
import sys

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

if k >= n:
    print("0")
    sys.exit(0)

H.sort()
print((sum(H[0:len(H) - k])))
# Original solution
N,K = input().split()
H = input().split()

if N < K:
    times = int(N)
else:
    times = int(K)

H_i =[int(i) for i in H]

for i in range(times):
    H_i.remove(max(H_i))

print((sum(H_i)))

# Optimized solution
enemmyCountN,killerTimeK = list(map(int,input().split()))
enemyHp = list(map(int,input().split()))

enemyHp.sort()

resultEnemyCount = enemmyCountN - killerTimeK
countNormal = 0

if killerTimeK >= enemmyCountN:
    print((0))

else:
    for i in range(resultEnemyCount):
        countNormal += enemyHp[i]
    print(countNormal)
# Original solution
#!/usr/bin/env python3
import sys
N, K = list(map(int, input().split()))
H = sorted(list(map(int, input().split())), reverse=True)
l = len(H)
if K != 0:
    if len(H) <= K:
        print((0))
        sys.exit()
    for i in range(K):
        H.pop(0)
    if len(H)==0:
        print((0))
    else:
        print((sum(H)))
else:
    print((sum(H)))

# Optimized solution
#!/usr/bin/env python3
import sys
N, K = list(map(int, input().split()))
H = sorted(list(map(int, input().split())), reverse=True)
l = len(H)
if K != 0:
    if len(H) <= K:
        print((0))
    else:
        print((sum(H[K:])))
else:
    print((sum(H)))
# Original solution
#!/usr/bin/env python3
import sys
N, K = list(map(int, input().split()))
H = sorted(list(map(int, input().split())), reverse=True)
l = len(H)
if K != 0:
    if len(H) <= K:
        print((0))
    else:
        print((sum(H[K:])))
else:
    print((sum(H)))

# Optimized solution
#!/usr/bin/env python3
import sys
N, K = list(map(int, input().split()))
H = sorted(list(map(int, input().split())), reverse=True)
if K != 0:
    if len(H) <= K:
        print((0))
    else:
        print((sum(H[K:])))
else:
    print((sum(H)))
# Original solution
#!/usr/bin/env python3
import sys
N, K = list(map(int, input().split()))
H = sorted(list(map(int, input().split())), reverse=True)
if K != 0:
    if len(H) <= K:
        print((0))
    else:
        print((sum(H[K:])))
else:
    print((sum(H)))

# Optimized solution
#!/usr/bin/env python3
N, K = list(map(int, input().split()))
H = sorted(list(map(int, input().split())), reverse=True)
if K != 0:
    if len(H) <= K:
        print((0))
    else:
        print((sum(H[K:])))
else:
    print((sum(H)))
# Original solution
n, k = list(map(int, input().split()))
h = [int(i) for i in input().split()]
h.sort()
del h[-1:-ｋ-1:-1]
print((sum(h)))

# Optimized solution
n, k = list(map(int, input().split()))
h = [int(i) for i in input().split()]
h.sort(reverse=True)
print((sum(h[k:])))
# Original solution
N, K = list(map(int, input().split()))
H = list(map(int, input().split()))
if N <= K:
    print((0))
else:
    H.sort(reverse=True)
    print((sum(H[K:])))

# Optimized solution
N, K = list(map(int, input().split()))
H = sorted(map(int, input().split()), reverse=True)
ans = sum(H[K:])
print(ans)
# Original solution
a=[int(i) for i in input().split()]
b=[int(i) for i in input().split()]
if a[1]>=a[0]:
    print((0))
else:
    c=[]
    if a[0]<=a[1]*2:
        for i in range(a[0]-a[1]):
            c.append(min(b))
            b.remove(min(b))
        print((sum(c)))
    else:
        for i in range(a[1]):
            b.remove(max(b))
        print((sum(b)))

# Optimized solution
a=[int(i) for i in input().split()]
b=[int(i) for i in input().split()]
if a[1]>=a[0]:
    print((0))
else:
    print((sum(sorted(b)[:a[0]-a[1]])))
# Original solution
a = list(map(int, input().split()))
b = list(map(int, input().split()))

b.sort(reverse=True)
x=a[1]
y=a[0]
if x>=y:
	print((0))
else:
	for i in range(x):
		del b[0]
	print((sum(b)))

# Optimized solution
a = list(map(int, input().split()))
b = list(map(int, input().split()))

b.sort()
x=a[1]
y=a[0]
if x>=y:
	print((0))
else:
	z=y-x
	b=b[0:z]
	print((sum(b)))
# Original solution
n,k=list(map(int,input().split()))
H=list(map(int,input().split()))
H.sort()
H.reverse()
for i in range(k):
    if len(H)>0:
        H.pop(0)
print((sum(H)))

# Optimized solution
n,k=list(map(int,input().split()))
H=list(map(int,input().split()))
H.sort()
if n>k:
    for i in range(k):
        H.pop(n-i-1)
    ans=sum(H)
else:
    ans=0
print(ans)
# Original solution
N, K = list(map(int, input().split()))
lists = list(map(int, input().split()))
if K == 0:
    print((sum(lists)))
    exit()

if K <= len(lists):
    for i in range(K):
        max_lists = lists.remove(max(lists))
else:
    print((0))
    exit()

# print(lists)

print((sum(lists)))

# Optimized solution
N, K = list(map(int, input().split()))
lists = list(map(int, input().split()))
if K == 0:
    print((sum(lists)))
    exit()

if K <= len(lists):
    # for i in range(K):
    #     max_lists = lists.remove(max(lists))
    lists = sorted(lists)[:N - K]
    print((sum(lists)))
    exit()
else:
    print((0))
    exit()

# print(lists)
# Original solution
N, K = list(map(int, input().split()))
H_list = list(map(int, input().split()))
if N-K <= 0:
    print((0))
else:
    for _ in range(K):
        A = H_list.index(max(H_list))
        H_list[A] = 0
    print((sum(H_list)))

# Optimized solution
N, K = list(map(int, input().split()))
H_list = list(map(int, input().split()))
if N-K <= 0:
    print((0))
else:
    H_list.sort()
    print((sum(H_list[0:N-K])))
# Original solution
# coding:UTF-8

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

count = 0

for k in range(0, K):
    health[health.index(max(health))] = 0

print((sum(health)))


# Optimized solution
# coding:UTF-8

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

count = 0

health = sorted(health,reverse=True)

print((sum(health[K:])))
# Original solution
N,K = list(map(int,input().split())) #K = super attack!!
Monsters = [_ for _ in map(int,input().split())]
res = 0
#一番体力の多いモンスターから、Kで殺していく。あとは一足すだけ。
Monsters.sort(reverse = True) #多い順
for i in range(K):
    if Monsters != []:
        Monsters.remove(Monsters[0])
res += sum(Monsters)
print(res)

# Optimized solution
N,K = list(map(int,input().split())) #K = super attack!!
Monsters = [_ for _ in map(int,input().split())]
res = 0
#一番体力の多いモンスターから、Kで殺していく。あとは一足すだけ。
Monsters.sort(reverse = True) #多い順
res += sum(Monsters[K:N+1])
print(res)
# Original solution
h, n = list(map(int,(input().split())))
a = list(map(int,(input().split())))
import sys
sys.setrecursionlimit(10 ** 9) #再帰用

a.sort()

if h >= n and n !=0 :
  for i in range(n):
    a.pop()
    ans = sum(a)
elif n ==0:
  ans = sum(a)
else:
  ans = 0
  
print(ans)

# Optimized solution
h, n = list(map(int,(input().split())))
a = list(map(int,(input().split())))
import sys
sys.setrecursionlimit(10 ** 9) #再帰用

a.sort(reverse=True)

if h >= n and n !=0 :
  a = a[n:]
  ans = sum(a)
elif n ==0:
  ans = sum(a)
else:
  ans = 0
  
print(ans)
# Original solution
n, k = list(map(int, input().split()))
ls = list(map(int, input().split()))
m = [0 for l in range(0, k)]
for i in range(0,len(ls)):
    for j in range(0,len(m)):
        if m[j]<ls[i]:
            c = m[j:]
            m[j] = ls[i]
            m[j+1:] = c[:-1]
            break
print((sum(ls)-sum(m)))

# Optimized solution
n, k = list(map(int, input().split()))
ls = list(map(int, input().split()))

def merge_sort(arr):
    if len(arr) <= 1:
        return arr

    mid = len(arr) // 2
    # ここで分割を行う
    left = arr[:mid]
    right = arr[mid:]

    # 再帰的に分割を行う
    left = merge_sort(left)
    right = merge_sort(right)

    # returnが返ってきたら、結合を行い、結合したものを次に渡す
    return merge(left, right)


def merge(left, right):
    merged = []
    l_i, r_i = 0, 0

    # ソート済み配列をマージするため、それぞれ左から見ていくだけで良い
    while l_i < len(left) and r_i < len(right):
        # ここで=をつけることで安定性を保っている
        if left[l_i] <= right[r_i]:
            merged.append(left[l_i])
            l_i += 1
        else:
            merged.append(right[r_i])
            r_i += 1

    # 上のwhile文のどちらかがFalseになった場合終了するため、あまりをextendする
    if l_i < len(left):
        merged.extend(left[l_i:])
    if r_i < len(right):
        merged.extend(right[r_i:])
    return merged

ll = merge_sort(ls)
if n <= k:
    print((0))
else:
    print((sum(ll[:n-k])))
# Original solution
n,k=list(map(int,input().split()))
h=list(map(int,input().split()))
h.sort(reverse=True)
for _ in range(min(k,n)):
    h.pop(0)
print((sum(h)))

# Optimized solution
n,k=list(map(int,input().split()))
h=list(map(int,input().split()))
h.sort(reverse=True)
# for _ in range(min(k,n)):
#     h.pop(0)
print((sum(h[min(k,n):])))
# Original solution
N, K = list(map(int, input().split()))
H = [int(N) for N in input().split()]
for i in range(0, K):
    if H[H.index(max(H))] == 0:
        break
    H[H.index(max(H))] = 0
print((sum([x for x in H if x != 0])))


# Optimized solution
N, K = list(map(int, input().split()))
H = [int(N) for N in input().split()]
H.sort(reverse=True)
if N <= K:
    print((0))
else:
    for i in range(0, K):
        H[i] = 0
    print((sum(H)))
# Original solution

N, K=list(map(int,input().split()))
arr = list(map(int,input().split()))
if(K>= N):
  print('0')
else:
  if (K > 0):
    for i in range(K):
      arr.remove(max(arr))

  print((sum(arr)))


# Optimized solution
N, K=list(map(int,input().split()))
arr = list(map(int,input().split()))
if(K>= N):
  print('0')
else:
  if (K > 0):
    new_arr = sorted(arr)
    arr = new_arr[:-K]
  print((sum(arr)))
# Original solution
n, k = list(map(int, input().split()))
h = list(map(int, input().split()))
for i in range(k):
  h[h.index(max(h))] = 0
print((sum(h)))

# Optimized solution
n, k = list(map(int, input().split()))
h = list(map(int, input().split()))
if n <= k:
    print((0))
else:
    h.sort()
    print((sum(h[0:len(h)-k])))
# Original solution
N,K=list(map(int,input().split()))
H=list(map(int,input().split()))
if K >= N:
    print((0))
else:
    for _ in range(K):
        H.pop(H.index(max(H)))
    print((sum(H)))

# Optimized solution
N,K=list(map(int,input().split()))
H=list(map(int,input().split()))
H.sort(reverse=True)
if K >= N:
    print((0))
else:
    print((sum(H[K:])))
# Original solution
import math
N, K = list(map(int, input().split()))
H = list(map(int, input().split()))
H.sort(reverse=True)
if K >= len(H):
  print((0))
else:
  print((sum(H[K:])))

# Optimized solution
def solve():
  N, K = list(map(int, input().split()))
  H = list(map(int, input().split()))
  if K>=N:
    return 0
  H.sort()
  ans = sum(H[:N-K])
  return ans
print((solve()))
# Original solution
def solve():
  N, K = list(map(int, input().split()))
  H = list(map(int, input().split()))
  if K>=N:
    return 0
  H.sort()
  ans = sum(H[:N-K])
  return ans
print((solve()))

# Optimized solution
def solve():
  N, K = list(map(int, input().split()))
  H = list(map(int, input().split()))
  H.sort()
  ans = sum(H[:max(N-K,0)])
  return ans
print((solve()))
# Original solution
#!/usr/bin/env python3
from itertools import product, permutations, combinations
from bisect import bisect_right,bisect_left
INF = float('inf')

N, K=list(map(int, input().split()))
HP=sorted(list(map(int, input().split())), reverse=True)

for i in range(K):
    if len(HP) > 0:
        HP.pop(0)

print((sum(HP)))

# Optimized solution
#!/usr/bin/env python3
from itertools import product, permutations, combinations
from bisect import bisect_right,bisect_left
INF = float('inf')

N, K=list(map(int, input().split()))
HP=sorted(list(map(int, input().split())), reverse=True)
cnt = 0
for i in range(N):
    if K > 0:
        K -= 1
        continue
    cnt += HP[i]

print(cnt)
# Original solution
N, K = list(map(int, input().split()))
H = list(map(int, input().split()))

if K >= N:
    print((0))
else:
    for i in range(K):
        del H[H.index(max(H))]
    print((sum(H)))


# Optimized solution
N, K = list(map(int, input().split()))
H = list(map(int, input().split()))

if K >= N:
    print((0))

else:
    H.sort(reverse=True)
    print((sum(H[K:])))
# Original solution
import math

n, k = [int(x) for x in input().split()]

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

if n <= k:
    print("0")
else:
    s_n = sorted(h_n)

    print((sum(s_n[:n-k])))

# Optimized solution
n, k = [int(x) for x in input().split()]

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

if n <= k:
    print("0")
else:
    print((sum(sorted(h_n)[:n - k])))
# Original solution
n,k = list(map(int,input().split()))
P = list(map(int,input().split()))

c=0
P.sort( reverse=True )

if k>len(P):
    k=len(P)
for i in range(k):
    if P.count==0 :
        break
    P.remove(P[0])

ans = sum(P)

print(ans)



# Optimized solution
n,k = list(map(int,input().split()))
P = list(map(int,input().split()))

c=0
P.sort( reverse=True )

if k>len(P):
    k=len(P)
for i in range(k):
    c+=1    

ans = sum(P[c:])

print(ans)
# Original solution
import heapq

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

minus_H = [i * (-1) for i in H]
heapq.heapify(minus_H)

for i in range(min(N, K)):
    heapq.heappop(minus_H)

ans = - sum(minus_H)

print(ans)


# Optimized solution
N, K = list(map(int, input().split()))
H = list(map(int, input().split()))

H.sort(reverse = True)

if K >= N:
    ans = 0
else:
    ans = sum(H[K:])

print(ans)
# Original solution
N, K = list(map(int, input().split()))
list_H = [int(x) for x in input().split()]

list_H.sort()

while K :
    if list_H :
        list_H.pop()
    K -= 1

sum = 0
while list_H :
    sum += list_H[0]
    list_H.pop(0)

print(sum)


# Optimized solution
N, K = list(map(int, input().split()))
list_H = [int(x) for x in input().split()]

list_H.sort()

while K :
    if list_H :
        list_H.pop()
    K -= 1

print((sum(list_H)))
# Original solution
n,k,*h=list(map(int,open(0).read().split()))
h=sorted(h)[::-1]
for i in range(min(k,n)):h[i]=0
print((sum(h)))

# Optimized solution
n,k,*h=list(map(int,open(0).read().split()))
print((sum(sorted(h)[:n-min(n,k)])))
# Original solution
n, k = list(map(int, input().split()))
h = list(map(int, input().split()))
h = sorted(h, reverse=True)

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


# Optimized solution
n, k = list(map(int, input().split()))
h = list(map(int, input().split()))
h = sorted(h, reverse=True)

print((sum(h[k:])))
# Original solution
n,k = list(map(int,input().split()))
a = list(map(int,input().split()))
a.sort(reverse=1)
ans = 0
for i in range(k,n):
    ans += a[i]
print(ans)


# Optimized solution
n,k = list(map(int,input().split()))
a = list(map(int,input().split()))
a.sort()
print((sum(a[:max(n-k,0)])))
# Original solution
import sys
N,K = list(map(int,input().split()))
H = list(map(int,input().split()))
if N-K <= 0:
    print((0))
    sys.exit()
for i in range(N-(N-K)):
    H.remove(max(H))
print((sum(H)))

# Optimized solution
N,K = list(map(int,input().split()))
H = list(map(int,input().split()))
H.sort(reverse=True)
a = 0
for i in range(K,N):
    a += H[i]
print(a)
# Original solution
N,K=list(map(int,input().split()))
if K>=N:
	print((0))
	quit()
L = [int(x) for x in input().split()]
L.sort()
if K:
	for _ in range(K):
		L.remove(L[-1])
print((sum(L)))

# Optimized solution
n,k=list(map(int,input().split()))
h=[int(i) for i in input().split()]
h.sort(reverse=True)

if k>=n:
    print((0))
else:
    print((sum(h[k:])))
# Original solution
N,K = list(map(int, input().split()))
H = list(map(int, input().split()))

H.sort(reverse=True)

ans = 0
for i in range(N):
    if i<K:
        pass
    else:
        ans += H[i]

print(ans)

# Optimized solution
N,K = list(map(int, input().split()))
H = list(map(int, input().split()))

list.sort(H, reverse=True)
for i in range(N):
    if i<=K-1:
        H[i] = 0

print((sum(H)))
# Original solution
import re
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
import functools
def v(): return eval(input())
def k(): return int(eval(input()))
def S(): return input().split()
def I(): return list(map(int,input().split()))
def X(): return list(eval(input()))
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10 ** 6)
mod = 10**9+7
cnt = 0
ans = 0
inf = float("inf")
al = "abcdefghijklmnopqrstuvwxyz"
AL = al.upper()

n, k=I()
h = l()
h.sort(reverse=True)

for i in range(k):
  if h:
    del h[0]
  else:
    break

print((sum(h)))

# Optimized solution
import re
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
import functools
def v(): return eval(input())
def k(): return int(eval(input()))
def S(): return input().split()
def I(): return list(map(int,input().split()))
def X(): return list(eval(input()))
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10 ** 6)
mod = 10**9+7
cnt = 0
ans = 0
inf = float("inf")
al = "abcdefghijklmnopqrstuvwxyz"
AL = al.upper()

n, k=I()
h = l()
h.sort(reverse=True)

print((sum(h[k:])))
# Original solution
n,k = list(map(int, input().split()))
h = list(map(int, input().split()))

h.sort(reverse=True)

ans = 0
for i in range(k, n):
  ans += h[i]
  
print(ans)

# Optimized solution
n,k = list(map(int, input().split()))
h = list(map(int, input().split()))

h.sort(reverse=True)
  
print((sum(h[k:])))
# Original solution
import sys


def solve():
    input = sys.stdin.readline
    mod = 10 ** 9 + 7
    n, k = list(map(int, input().rstrip('\n').split()))
    h = list(map(int, input().rstrip('\n').split()))
    h.sort()
    t = 0
    for i in range(n - k):
        t += h[i]
    print(t)


if __name__ == '__main__':
    solve()


# Optimized solution
import sys


def solve():
    readline = sys.stdin.buffer.readline
    mod = 10 ** 9 + 7
    n, k = list(map(int, readline().split()))
    h = list(map(int, readline().split()))
    h.sort(reverse=True)
    print((sum(h[k:n])))


if __name__ == '__main__':
    solve()
# Original solution
n,k = list(map(int, input().split()))
H = list(map(int, input().split()))
H.sort()
H.reverse()
if k>= len(H):
  print((0))
else:
  print((sum(H[k:len(H)])))

# Optimized solution
n,k = list(map(int, input().split()))
H = list(map(int, input().split()))

H.sort()
H.reverse()

if n <= k:
  print((0))
else:
  print((sum(H[k:n])))
# Original solution
N,K = list(map(int,input().split()))
H = sorted(list(map(int,input().split())))
print((sum(H[:N-min(N,K)])))

# Optimized solution
N,K = list(map(int,input().split()))
H = sorted(list(map(int,input().split())))[::-1]
print((sum(H[K:])))
# Original solution
h,n = list(map(int, input().split()))
a = list(map(int, input().split())) 

def max_pop(ary):
  max = 0
  ind = 0
  for i,a in enumerate(ary):
    if max < a:
      max = a
      ind = i
  del ary[i]
  return ary

def sum_ary(ary):
  total = 0
  for a in ary:
    total += a
  return total

if n >= len(a):
  print((0))
  exit()
for _ in range(n):
  a = max_pop(a)
print((sum_ary(a)))


# Optimized solution
h,n = list(map(int, input().split()))
a = list(map(int, input().split())) 

a = sorted(a, reverse=True)

def sum_ary(ary):
  total = 0
  for a in ary:
    total += a
  return total

if n >= len(a):
  print((0))
  exit()
del a[:n]
print((sum_ary(a)))
# Original solution
n, k = list(map(int, input().split()))
h = [int(i) for i in input().split()]

h = sorted(h, reverse=True)
is_zero = False
for i in range(k):
    try:
        del h[0]
    except:
        is_zero = True
        break
if is_zero:
    print((0))
else:
    print((sum(h)))

# Optimized solution
n, k = list(map(int, input().split()))
h = [int(i) for i in input().split()]

if n <= k:
    print((0))
else:
    h = sorted(h, reverse=True)
    print((sum(h[k:])))
# Original solution
N, K = list(map(int,input().split()))
H = list(map(int,input().split()))

count = 0
while 1:
    if K > 0:
        H[H.index(max(H))] = 0
        K -= 1
    else:
        break

count += sum(H)

print(count)

# Optimized solution
N, K = list(map(int,input().split()))
H = list(map(int,input().split()))

count = 0
H = sorted(H,reverse=True)

count += sum(H[K:])

print(count)
# Original solution
N,M = list(map(int,input().split()))
A =list(map(int,input().split()))
new_list = sorted(A, reverse=True)
ans = 0
for i in range(M):
    if not new_list:
        break
    else:
        del new_list[0]
        
if not new_list:
    print(ans)
else:
    ans +=sum(new_list)
    print(ans)

# Optimized solution
N,M = list(map(int,input().split()))
A =list(map(int,input().split()))
new_list = sorted(A, reverse=True)
ans = 0

del new_list[0:M]
        
if not new_list:
    print(ans)
else:
    ans +=sum(new_list)
    print(ans)
# Original solution
N,K = list(map(int,input().split()))
hp = list(map(int,input().split()))
hp_sort = sorted(hp)
if K < N:
    print((sum(hp_sort[0:N-K])))
else:
    print('0')





# Optimized solution
N,K = list(map(int,input().split()))
hp = list(map(int,input().split()))
if K < N:
    print((sum(sorted(hp)[0:N-K])))
else:
    print('0')
# Original solution
n,k = list(map(int, input().split()))
h = list(map(int, input().split()))

h.sort()
s = []
if k == 0:
    s = h
else:
    for i in range(k):
        s = h[:-k]

print((sum(s)))

# Optimized solution
n,k = list(map(int, input().split()))
h = list(map(int, input().split()))

h.sort()
s = []
if k == 0:
    s = h
else:
    s = h[:-k]

print((sum(s)))
# Original solution
N,K = list(map(int, input().split()))
H = list(map(int, input().split()))
 
H.sort(reverse=True)
 
K = min(K, len(H))
for k in range(K):
    H.pop(0)
 
print((sum(H)))

# Optimized solution
N,K = list(map(int, input().split()))
H = list(map(int, input().split()))

H.sort(reverse=True)

K = min(K, len(H))
HH = H[K:]

print((sum(HH)))
# Original solution
N, K = list(map(int, input().split()))
H = list(map(int, input().split()))
list.sort(H, reverse=True)
for i in range(K):
    if len(H) != 0:
        H.pop(0)
    else:
        print("0")
        exit()
print((sum(H)))

# Optimized solution
N, K = list(map(int, input().split()))
H = list(map(int, input().split()))
list.sort(H, reverse=True)
print((sum(H[K:])))
# Original solution
N,K = list(map(int,input().split()))
H = list(map(int,input().split()))
H = sorted(H)[::-1]
del H [0:K]
print((str(sum(H))))

# Optimized solution
N,K = list(map(int,input().split()))
H = list(map(int,input().split()))
H = sorted(H)[::-1]
H = H[K:N]
print((str(sum(H))))