peterverebics/CodeNet_Python_118 huggingface dataset:
N,K = map(int,input().split(" "))
l = list(map(int,input().split(" ")))
H = sorted(l,key=int) 
c = 0
if(K >= N):
    c = 0
else:
    for i in range(K):
        del H[-1]
    for i in H:
        c = c+i
print(c)
N, K = map(int, input().split())
H = sorted(list(map(int, input().split())))

if K == 0:
  print(sum(H))
else:
  print(sum(H[:-K]))
def submit():
    n, k = map(int, input().split())
    hlist = list(map(int, input().split()))

    if k >= n:
        print(0)
        return

    if k == 0:
        print(sum(hlist))
        return

    hlist.sort()
    print(sum(hlist[:-k]))


if __name__ == "__main__":
    submit()
n,k = map(int,input().split())	
li = list(map(int,input().split()))
li.sort(reverse=True)

if k==0:
    print(sum(li))
    exit()

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

for i in range(k):
    li[i]=0

print(sum(li))
import heapq
[n, k] = list(map(int, input().split()))
Healths = list(map(int, input().split()))
sum = 0
hh = heapq.nlargest(k, Healths)
for h in hh:
  sum+=h

sum2=0
for h in Healths:
  sum2+=h

print(sum2 - sum)
N,K=map(int,input().split())
List=list(map(int,input().split()))
S=sorted(List)[::-1]

del S[0:K]
print(sum(S))
nk = [int(i) for i in input().split()]
sum = 0

list = [int(i) for i in input().split()]
list.sort(reverse=True)

for i in range(nk[1], nk[0]):
  sum += list[i]

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

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

Hs = sorted(Hs)
print(sum(Hs[:max(N-K, 0)]))
n, k = map(int, input().split())
h = sorted(list(map(int, input().split())))
if k >= len(h):
    print("0")
else:
    for i in range(k):
        h.pop(-1)
    print(sum(h))
import sys
#import bisect
input = sys.stdin.buffer.readline
#lb = bisect.bisect_left

def main():
	N,K=map(int,input().split())
	vA=list(map(int, input().split()))
	#INF = 1001001001

	vA.sort()
	
	res = sum(vA[:-K]) if K else sum(vA)
	print(res)

main()
N, K = [int(i) for  i in input().split()]
H = [int(i) for  i in input().split()]

H.sort()

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

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

h=sorted(h,reverse=True)

s=h[k:]

print(sum(s))
n, k = map(int, input().split())
h = list(map(int, input().split()))
if n <= k:
    print(0)
    exit()
h.sort()
for i in range(k):
    h.pop()
print(sum(h))
N, K = map(int, input().split())
H = list(map(int, input().split()))

H.sort(reverse=True)

if K >= N:print(0)
else:
    print(sum(H[K:N]))
N, K = map(int,input().split())
H = list(map(int,input().split()))

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

count += sum(H[K:])

print(count)
n, k = map(int, input().split())
h = list(map(int, input().split()))
h = sorted(h, reverse=True)
print(sum(h[k:]))
def main():
    n, k = map(int, input().split())
    h = [int(x) for x in input().split()]
    h_s = sorted(h)
    if len(h_s) <= k:
        ans = 0
    else:
        for _ in range(k):
            h_s.pop()
        ans = sum(h_s)
    print(ans)

if __name__ == '__main__':
    main()
n, k = list(map(int, input().split()))
h = list(map(int, input().split()))
h.sort()
ans = 0
if n > k:
    for i in range(n - k):
        ans += h[i]
print(ans)
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]]))
n,k = map(int,input().split())
h = list(map(int,input().split()))

h.sort()
k = min(n,k)
for _ in range(k):
    h.pop()

print(sum(h))
n, k = (int(i) for i in input().split())
h = [int(i) for i in input().split()]
h.sort()
if n <= k:
    print(0)
    exit()
print(sum(h[:n-k]))
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# FileName: 	C
# CreatedDate:  2020-06-27 15:37:37 +0900
# LastModified: 2020-06-27 15:43:18 +0900
#


import os
import sys
# import numpy as np
# import pandas as pd


def main():
    n, k = map(int, input().split())
    h = list(map(int, input().split()))
    if n<=k:
        print(0)
        return
    h.sort()
#    print(h)
    print(sum(h[:n-k]))



if __name__ == "__main__":
    main()
N,K=map(int,input().split())
H=list(map(int,input().split()))
H.sort(reverse=True)
print(sum(H[K:]))
# coding: utf-8
N,K = map(int, input().split())#敵の数,必殺技回数
H = list(map(int, input().split()))#体力

if N<=K:
    print(0)
else:
    H.sort(reverse=True)
    sum = sum(H[K:])
    print(sum)
N, K = 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)
h,a = [int(x) for x in input().rstrip().split()]
l=[int(x) for x in input().rstrip().split()]
l.sort(reverse = True)

ans=0

del l[0:a]
ans = a
print(sum(l))
import sys

input = sys.stdin.readline


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

    H.sort()
    if K == 0:
        ans = sum(H)
    else:
        ans = sum(H[:-K])

    print(ans)


if __name__ == "__main__":
    main()
N, K = map(int, input().split())
H = list(map(int, input().split()))

ans = 0
H.sort(reverse=True)
for i in range(N):
    if K > 0:
        K -= 1
    else:
        ans += H[i]
print(ans)
# coding: utf-8


def solve(*args: str) -> str:
    n, k = map(int, args[0].split())
    H = list(map(int, args[1].split()))
    H.sort(reverse=True)

    return str(sum(H[k:]))


if __name__ == "__main__":
    print(solve(*(open(0).read().splitlines())))
n,k=map(int,input().split())
h=list(map(int,input().split()))
if n<=k:
    print(0)
else:
    t=sorted(h,reverse=1)
    t=t[:k]
    p=sum(h)-sum(t)
    print(p)
#C
N,K=map(int,input().split())
H=list(map(int,input().split()))
H.sort(reverse=True)
H=H[K:]
print(sum(H))
import sys
n,k=map(int,input().split())
h=list(map(int,input().split()))

h.sort(reverse=True)

if len(h)<=k:
    print('0')
    sys.exit()
else:
    del h[0:k]

a=sum(h)

print(a)
n, k = map(int, input().split())
h = list(map(int, input().split()))
h = sorted(h)
ans = 0
for i in range(max(0, n-k)):
    ans += h[i]

print(str(ans))
n=list(map(int,input().split()))
m=list(map(int,input().split()))
m.sort()
if(n[0]<=n[1]):
  print(0)
else:
  print(sum(m[0:n[0]-n[1]]))
H, K = map(int, input().split())
array = list(map(int, input().split()))
A = sorted(array, reverse=True)
del A[0:K]
print(sum(A))
import sys
import time
import math
import itertools as it
def inpl():
    return list(map(int, input().split()))
st = time.perf_counter()
# ------------------------------

N, K = inpl()
H = inpl()
H.sort()
H.reverse()
for i in range(K):
    if len(H) == i:
        break
    H[i] = 0
print(sum(H))

# ------------------------------
ed = time.perf_counter()
print('time:', ed-st, file=sys.stderr)
n,k=map(int,input().split())
h=sorted(list(map(int,input().split())))

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

H.sort(reverse = True)

print(sum(H[K:]))
n,k = map(int,input().split())
h = [int(i) for i in input().split()]
h.sort(reverse=True)
a = sum(h[min(k, n):])
print(a)
N,  K = map(int, input().split())
H = list(map(int, input().split()))

if N <= K:
    print(0)
else: 
    H.sort(reverse=True)
    del H[:K]
    print(sum(H))
from math import ceil

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

if k >= n:
    print(0)
    exit()
h.sort()
h.reverse()
suma = sum(h) - sum(h[:k])
print(suma)
N, K = [int(x) for x in input().split()]
H = [int(x) for x in input().split()]
H.sort(reverse=True)
print(sum(H[K:]))
N, K = map(int, input().split())
A = list(map(int, input().split()))

if K >= N:
  print(0)
else:
  A.sort()
  A = A[::-1]
  answer = sum(A[K:])
  print(answer)
enemmyCountN,killerTimeK = map(int,input().split())
enemyHp = input().split()

enemyHp.sort()
print(enemyHp)
resultEnemyCount = enemmyCountN - killerTimeK
countNormal = 0


for i in range(resultEnemyCount):
    countNormal += int(enemyHp[i])

print(countNormal)
n,k,*h=map(int,open(0).read().split())
print(sum(sorted(h)[:min(n,n-k)]))
def main():
    N, K = map(int, input().split())
    H = list(map(int, input().split()))
    H = sorted(H, reverse=True)
    count = 0
    if K >= N:
        print(0)
    elif K == 0:
        print(sum(H))
    else:
        for i in range(K):
            H[i] = 0
            print(sum(H))


if __name__ == "__main__":
    main()
n,k=map(int,input().split())
hp=list(map(int,input().split()))
hp.sort(reverse=True)
print(sum(hp[-k:]))
import numpy as np
#入力
N, K = map(int, input().split())
li = list(map(int,input().split()))
list.sort(li, reverse = True)

#出力
a = list(np.zeros(K))
if N - K>0:
    b = list(np.ones(N-K))
    a.extend(b)
else:
    a = list(np.zeros(N))

print(np.dot(a, li))
import sys
import math
from collections import deque
input = sys.stdin.readline
N, K = map(int,input().split())
H = list(map(int,input().split()))
ans = 0
for i in range(N-K):
    ans += H[i]
print(ans)
n, k = map(int, input().split(' '))
nums = list(map(int, input().split(' ')))
nums.sort(reverse=True)
if k >= n:
  print(0)
else:
  if k > 0:
    nums = nums[:k]
  print(sum(nums))
n, k = map(int, input().split())
lst = sorted(list(map(int, input().split())))

if (n<=k):
  print(0)
else:

  sum_count = 0
  sum_count = sum(lst[:-k])
  print(sum_count)
N, K = map(int, input().split())
H = list(map(int, input().split()))
print(H)
for i in range(min(K,N)):
    saidai = max(H)
    H.remove(saidai)
print(H)

print(sum(H))
a = []
a = input().split()
N = int(a[0])
K = int(a[1])
H = input().split()
H = [int(i) for i in H]
#print('N=', N, 'K=', K)
#print('H=', H)

H = sorted(H, reverse = True)
#print('sort H=', H)

if K == 0:
  H = H
if K == 1:
  del H[0]
if K > 1:
  del H[0 : K - 1]
#print('del H=', H)

T = sum(H)
print(T)
n,k = map(int,input().split())

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

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

H.reverse()

cnt = 0

print(sum(H[K:]))
n,k=map(int,input().split())
h=sorted(list(map(int,input().split())))
l=h[:-k]
print(sum(l))
N, K = map(int, input().split())
H = list( map(int, input().split()) )
H.sort()
#h = H[:N-K]
print(sum(H[0:N-K]))
n,k = map(int,input().split())
h = list(input().split())
h.sort()
ans = int(0)
if k >= n:
    print(ans)
else:
    for i in range(n - k):
        ans += int(h[i])
    print(ans)
N,K = map(int,input().split())
H = list(map(int,input().split()))
H.sort
if N<=K:
    print(N)
else:
    print(sum(H[N-K:]))
N, K = map(int, input().split())
H = list(map(int, input().split()))
H = H[:-K]
print(sum(H))
def main():
    n, k = map(int, input().split())
    inlis = list(map(int, input().split()))
    inlis.sort()

    if k >= n:
        print(0)
    total = sum(inlis[:-k])
    print(total)

    
if __name__ == "__main__":
    main()
import numpy as np
N,K = map(int,input().split())
H = list(map(int,input().split()))
H.sort
j=0
if K >= N:
    print(N)
else:
    for i in range (N-K):
        j+=H[i]
    print(j+K)
import sys
input = lambda : sys.stdin.readline().rstrip()
sys.setrecursionlimit(max(1000, 10**9))
write = lambda x: sys.stdout.write(x+"\n")


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

h.sort()
print(sum(h[:-k]))
n,k = map(int, input().split())
H = list(map(int, input().split()))
sum = 0
l = n-k
sorted(H)
if k >= n : print(0)
else:
    for i in range(l):
        sum += H[i]
    print(sum)
N, K = [int(i) for i in input().split(' ')]
H = list(reversed([int(i) for i in input().split(' ')]))
print(sum(H[K:]))
N,K=map(int,input().split())
List=list(map(int,input().split()))
S=sorted(List)
if K==0:
    i=1
else:
    i=0
del S[i:K+1]
print(sum(S))
N,K = map(int,input().split())
H = list(map(int,input().split()))
H.sort()
H.reverse()
if K==0:
        pass
elif K==1:
        del H[0]
else:
   del H[0:K-1]
a = 0

for i in H:
        a+=i
print(a)
N,K = map(int,input().split())
enemys = list(map(int,input().split()))
enemys = sorted(enemys)
if K >= len(enemys):
  print(0)
else:
  enemys = enemys[K:]
  print(sum(enemys))
N = list(map(int,input().rstrip().split()))
n = N[0]
k = N[1]

h = list(map(int,input().split()))
h.sort(reverse=True)

m = 0
hit = 0
if k >= n :
  m = 0
else:
  for i in range(k,n):
    hit += h[i]
  
  m = hit
print(type(m))
print(m)
N, K = map(int,input().split())
H = list(map(int,input().split()))

H.reverse()

cnt = 0

for i in range(K,len(H)):
    cnt += H[i]

print(cnt)
from sys import stdin


def main(inp1, inp2):
    n, k = [int(i) for i in inp1.split(sep=' ')]
    h_list = sorted([int(i) for i in inp2.split(sep=' ')])

    print(h_list)
    num_enemy = n
    enable_special = k

    if enable_special >= num_enemy:
        return 0
    elif enable_special == 0:
        return sum(h_list)
    else:
        return sum(h_list[:-enable_special])


if __name__ == '__main__':
    input1 = stdin.readline().rstrip()
    input2 = stdin.readline().rstrip()
    ret = main(input1, input2)
    print(ret)
n, k = map(int, input().split())
h = list(map(int, input().split()))
h = sorted(h)
# print(h[:-1], h)
if k > len(h):
    print(0)
else:
    if k != 0:
        del h[-k]
    print(sum(h))
from collections import deque

h, k, *a = map(int, open(0).read().split())
if h <= k:
    print(k)
    exit()

a.sort()
q = deque(a)

[q.pop() for _ in range(k)]
print(q)
print(sum(q))
N, K = map(int, input().split(" "))
H = list(map(int, input().split(" ")))

if N <= K:
  print(0)
else:
  if K == 0:
    c = sum(H)
  else:
    c = sum(H[:-K])
  print(c)
import sys,collections,math,random,fractions,bisect;sys.setrecursionlimit(10**7)
sr = sys.stdin.readline; P = print; P2 = lambda x: print(*x, sep="\n")
def I(i=0): t = [int(x)-i for x in sr().split()];return t if len(t) > 1 else t[0]
def S(): t = sr().split(); return t if len(t) > 1 else t[0]
L1,L2,L3,L4, = [],[],[],[]

N,K = I()
A = I()
if N == K:
    print(0)
else:
    print(sum(sorted(A)[:N-K]))
n, k = map(int, input().split())
h = sorted(list(map(int, input().split())), reverse=True)
if n > k:
  print(sum(h[k:]))
else:
  print(sum(h))
'''N, K = map(int, input().split())
H = list(map(int, input().split()))

for i in range(K):
    if len(H)!=0:
        H.remove(max(H))
        #print(H)
    else:
        #print(0)
        break
print(sum(H))'''

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

print(sum(H[K+1:]))
l, k = map(int, input().split(" "))
if k >= l:
  print(0)
else:
  print(sorted(map(int, input().split(" ")))[:l-k])
# Input(n = num of monsters/k = num of special attacks)
n, k = input().split()
a = list(map(int, input().split()))

# Variable declarations
n = int(n)
k = int(k)
attacks = 0

# Calculating how many attacks fennec needs.
for i in range(n-k):
    if k > n:
        break
    attacks += a[i]

# Printing how many attacks fennec needs.
print(attacks)
n,k = map(int,input().split())
h = list(input().split())
h.sort()
ans = int(0)
for i in range(n - k):
    ans += int(h[i])
print(ans)
H,K=map(int,input().split())
H=list(map(int,input().split()))
H.sort()
print(sum(H[0:len(H)-K+1]))
N,K=map(int,input().split())
a=list(map(int,input().split()))
if K>=N:
	print(0)
b=sorted(a)
c=0
for i in range(N-K):
	c+=b[i]
print(c)
N, K = map(int, input().split())
sum(sorted(map(int, input().split()), reverse=True)[K:])
N, K = list(map(int, input().split()))
H = list(map(int, input().split()))
result = sum(reversed(sorted(H)[K:]))
print(int(result))
N, K = map(int, input().split())
H = list(map(int, input().split()))
H.sort()
print(sum(H[:N-K]))
n,k=map(int,input().split())
hi=[]
for i in map(int,input().split()):
    hi.append(i)
if n<=k:
    print(0)
else:
    hi.sort
    hsum=0
    for i in range(n-k):
        hsum=hsum+hi[i]
    print(hsum)
# -*- coding: utf-8 -*-


def main():
    n, k = map(int, input().split())
    h = list(map(int, input().split()))

    total = sum(h)

    if k >= n:
        print(0)
    elif k == 0:
        print(total)
    else:
        print(total - sum(sorted(h[k + 1:], reverse=True)))


if __name__ == '__main__':
    main()
n,k=map(int,input().split())
hp=list(map(int,input().split()))
sorted(hp)
re=sum(hp[:n-k])
print(re)
N, K = map(int, input().split())
monsterList = [int(x) for x in input().split()]

atackTimes = 0

monsterList.sort()
for hp in monsterList[:-K]:
    atackTimes += hp

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

def solve():
    global n, k, h
    if n <= k:
        return 0
    s = sum(h)
    h = sorted(h, reverse=True)
    for i in range(k):
        print(h[i])
        s -= h[i]
    return s

print(solve())
data = input().split()

n = int(data[0])
k = int(data[1])

hp = input().split()
hp.sort()

ans = 0
for i in range(n - k):
  ans += int(hp[i])

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

h = sorted(h,reverse=True)

attack_n = 0

if k >= n:
    pass

else:
    for i in h[n-k-1:]:
        attack_n += i

print(attack_n)
import sys
sys.setrecursionlimit(int(1e6))

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

H.sort()
n = len(H) - K
ans = sum(H[:n])
print(ans)
args = input().split()
args2 = input().split()
args2.sort()
N = int(args[0])
K = int(args[1])
S = 0

for i in range(N-K):
	S += int(args2[i])

print(S)
import heapq

N,K = (int(x) for x in input().split())
H = list((-1)*(int(x)) for x in input().split())
heapq.heapify(H)

for _ in range(K):
    if len(H) == 1:
        print(0)
        break

    heapq.heappop(H)

if len(H) != 1:
    sum = 0
    for _ in range(len(H)):
        sum -= heapq.heappop(H)

    print(sum)
i = list(map(int, input().split()))
j= list(map(int, input().split()))
x=sorted(j, reverse=True)
z=0

if i[1]>=len(j):
  print(0)
else:
  for a in range(i[0],len(x)):
    z+=x[a]
  print(z)
n,k = map(int,input().split())
h= list(map(int,input().split()))
sorted(h)
print(sum(h[:-k+1]))
n, k = map(int, input().split())
H = list(map(int, input().split()))
sH = sorted(H, reverse=True)
ans = sum(sH[k:n-1:])
print(ans)
n, k= map(int, input().split())
h = list(map(int, input().strip().split()))
import numpy as np
hnp = np.asarray(h)
if(k >= n):
    print(0)
else:    
    s = n-k
    print(np.sum(hnp[:s]))
N,K=map(int,input().split())
H_list=list(map(int,input().split()))
H_list=sorted(H_list)
del H_list[-K:]
if len(H_list)==0:
  print('0')
else:
  print(sum(H_list))
n, k = map(int, input().split())
h = list(map(int, input().split()))

h.sort()

print(sum(h[:n-k]))
a,b=input().split()
a=int(a)
b=int(b)
c=list(map(int,input().split()))
c.sort()
d=sum(c)
e=0
if a<b:
  print(0)
else:
  for i in range(b):
    e=e+c[-b]
  print(d-e)
n, k = map(int, input().split())
H = list(map(int, input().split()))
H.sort()
if k >= n:
    print(0)
else:
    print(sum(H[max(0, -k-1):]))
def main():
  N, K = map(int,input().split())
  H = list(map(int,input().split()))
  H.sort()
  print(sum(H[:-K]))
  return

main()
N, K = map(int, input().split())
H = list(map(int, input().split()))
if N <= K:
  print(0)
else:
  print(sum(H[:N-K]))
#https://atcoder.jp/contests/abc153/tasks/abc153_c
N,K =map(int,input().split())
M_List = sorted(list(map(int,input().split())))
if N<=K:
    print(0)
else:
    print(sum(M_List[:K*(-1)]))
n,k = map(int,input().split())
h = list(map(int,input().split()))
if n <= k:
    print(0)
else:
    h.sort()
    print(sum(h[:-k]))
eneNum, spNum = map(int, input().split())
eneHp = map(int, input().split())
eneHpList = list(eneHp)

# TLE
#count = 0
#for i in range(spNum):
#    if len(eneHpList) > 0:
#        maxEneHp = max(eneHpList)
#        eneHpList.remove(maxEneHp)

# new method
eneHpList.reverse()
del eneHpList[0:spNum]
count = sum(eneHpList)

print("{}".format(count))
N, K = input().split()
H = input().split()

H.sort()
N = int(N)
K = int(K)
sum = 0
if(N - K <= 0):
  	sum = 0
else:
	for i in range(N):
	  if(i < N - K):
	    	sum += int(H[i])

print(sum)
n, k = [int(i) for i in input().split()]
h = [int(j) for j in input().split()]

h = sorted(h)
del h[n-k:n]

print(sum(h))
N,K = map(int,input().split())
H = [int(i) for i in input().split()]

if K >= N:
  print(0)
else:
  I = sorted(H)
  a = 0
  for i in range(N-K):
    a += H[i]
  print(a)
N, K = list(map(int, input().split()))
enemy = sorted(list(map(int, input().split())), reverse=True)
 
if K > len(enemy):
  print(0)
  
sum = 0
for x in enemy[K:]:
  sum += x
print(sum)
n,k=map(int,input().split())
hlist = list(map(int,input().split()))

hlist.sort(reverse=True)
print(hlist)

if n<k:
    k = n
for i in range(0,k):
    hlist[i] = 0

print(sum(hlist))
# -*- coding: utf-8 -*-


def main():
    n, k = map(int, input().split())
    h = list(map(int, input().split()))

    total = sum(h)

    if k >= n:
        print(0)
    elif k == 0:
        print(total)
    else:
        print(sum(sorted(h[k + 1:], reverse=True)))


if __name__ == '__main__':
    main()
n, k = map(int, input().split())
h = list(map(int, input().split()))

if n <= k:
    print(0)
elif k == 0:
    print(sum(h))
else:
    h.sort()
    print(h[:-k])
    print(sum(h[:-k]))
N, K = map(int, input().split())
lst = list(map(int, input().split()))
lst.sort(reverse=True)
ans = 0

if N <= K:
  print(N)
else:
  print(sum(lst[K:])+K)
n, k = map(int, input().split())
data = list(map(int, input().split()))

max = max(data)
sum = sum(data)

print(sum - max)
# ABC153
# C

N, K = input().split()
H_list = input().split()
H_list.sort(reverse=True)

count = 0
for i in range(int(K),len(H_list)):
    count += int(H_list[i])

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

L.sort()
print(sum(L[:N-K]), + K)
n, k = map(int, input().split())
h = list(map(int, input().split()))

h.reverse()

if k>=len(h):
    print(0)

else:
    h = h[k:]
    print(sum(h))
import numpy as np
import numpy

N,K =(float(x) for x in input().split())
list1 = np.array([float(s) for s in input().split()])
print(list1)

list2=np.sort(list1)

i=0
sum=0
while i<N-K:
  sum=sum+list2[i]
  i=i+1

print(sum)
import sys
import math
from collections import deque
input = sys.stdin.readline
N, K = map(int,input().split())
H = deque(map(int,input().split()))
ans = 0
for i in range(N-K):
    ans += H[i]
print(ans)
N, K = map(int,input().split())
Monsters = list(map(int,input().split()))
Monsters = sorted(Monsters)

for i in range(min(K,N)):
    Monsters[i]=0
print(sum(Monsters))
N,K=map(int,input().split())
H=list(map(int,input().split()))
H.sort()
if K>=N:
  print(0)
else:
  H=H[K:]
  print(sum(H))
N, K = map(int,input().split())

H = list(input().split())

H.sort()

sum = 0

for i in range(N-K):
    sum = sum+int(H[i])
    
print(sum)
n, k = map(int, input().split())
H = list(map(int, input().split()))
sH = sorted(H, reverse=True)
ans = sum(sH[k-1:n-1:])
print(ans)
n,k=map(int,input().split())
#hp=list(map(int,input().split()))
hp=[int(x) for x in input().split()]
hp.sort()
if n>=k:
	re=sum(hp[:n-k])
else:
	re=len(hp)
print(re)
import math

n,k = map(int, input().split())
hlist = input().split()
hlist.sort()

sum = 0
for i in range(n-k):
  sum = sum + int(hlist[i])
print(sum)
HK = list(map(int, input().split()))
M = list(map(int, input().split()))

M.sort(reverse=True)

k = HK[1]

while k > 0 | len(M) > 0:
    M.pop(0)
    k -= 1

damage = 0
for i in range(len(M)):
    damage += M[i]

print(damage)
R = lambda: map(int, input().split())
n, k = R()
print(sum(sorted(R())[:n - k]))
n , k = map(int, input().split())
hp = input().split()

sum_hp = 0

hp.sort()

for i in range(k):
    if(len(hp)> 0):
        hp.pop()


for j in hp:
    sum_hp = sum_hp + int(j)

print(str(sum_hp))
list = input().split(" ")
N = int(list[0])
K = int(list[1])
list_hp = input().split(" ")
list_hp = [int(i) for i in list_hp]
list_hp = sorted(list_hp)
print(list_hp)

if K < N:
    sum = 0
    for i in range(N-K):
        sum = sum + list_hp[i]
    print(sum)
else:
    print(0)
N,K=map(int,input().split())
L=list(map(int,input().split()))
L=sorted(L)
print(sum(L[:-K]))
n,k = map(int, input().split())
H = list(map(int, input().split()))
l = n-k
sorted(H)
if k >= n : print(0)
else:
    print(sum(H[:l]))
N,K = map(int,input().split())
H = list(map(int,input().split()))
if K==0:
    print(sum(H))
elif N>K:
    x=max(H)
    print(sum(H)-x)
else:
    print(0)
n,k = input().split()
k = int(k)
n =int(n)

healths = input().split()
res = 0

healths.sort()
for i in range(n-k):
    res = res + int(healths[i])

print(res)