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

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

arr.sort()

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

else: print((sum(arr[:n-k])))

def main():

	x = [int(i) for i in input().split()]

	y = [int(i) for i in input().split()]

	y.sort()

	if (x[1]!=0):

		z = y[:-x[1]]

	else:

		z = y

	print((sum(z)))

if __name__== "__main__":

	main()
n, k = list(map(int, input().split()))
arr = list(map(int, input().split()))
arr.sort()
if k >= n:
    print((0))
else:
    print((sum(arr[: n - k])))

def main():
    x = [int(i) for i in input().split()]
    y = [int(i) for i in input().split()]
    y.sort()
    if x[1] != 0:
        z = y[: -x[1]]
    else:
        z = y
    print((sum(z)))


if __name__ == "__main__":
    main()

-n, k = list(map(int, input().split())) -arr = list(map(int, input().split())) -arr.sort() -if k >= n: -    print((0)) -else: -    print((sum(arr[: n - k]))) +def main(): +    x = [int(i) for i in input().split()] +    y = [int(i) for i in input().split()] +    y.sort() +    if x[1] != 0: +        z = y[: -x[1]] +    else: +        z = y +    print((sum(z))) + + +if __name__ == "__main__": +    main()