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

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



h = sorted(h)

h[-1:-k-1:-1] = [0,] * min(n, k)



print((sum(h)))
import sys



readline = sys.stdin.readline

MOD = 10 ** 9 + 7

INF = float('INF')

sys.setrecursionlimit(10 ** 5)





def main():

    N, K = list(map(int, readline().split()))

    H = list(map(int, readline().split()))

    H.sort()



    if N <= K:

        ans = 0

    else:

        ans = sum(H[:N - K])

    print(ans)





if __name__ == '__main__':

    main()

n, k = [int(i) for i in input().split()]
h = [int(i) for i in input().split()]
h = sorted(h)
h[-1 : -k - 1 : -1] = [
    0,
] * min(n, k)
print((sum(h)))

import sys

readline = sys.stdin.readline
MOD = 10**9 + 7
INF = float("INF")
sys.setrecursionlimit(10**5)


def main():
    N, K = list(map(int, readline().split()))
    H = list(map(int, readline().split()))
    H.sort()
    if N <= K:
        ans = 0
    else:
        ans = sum(H[: N - K])
    print(ans)


if __name__ == "__main__":
    main()

-n, k = [int(i) for i in input().split()] -h = [int(i) for i in input().split()] -h = sorted(h) -h[-1 : -k - 1 : -1] = [ -    0, -] * min(n, k) -print((sum(h))) +import sys + +readline = sys.stdin.readline +MOD = 10**9 + 7 +INF = float("INF") +sys.setrecursionlimit(10**5) + + +def main(): +    N, K = list(map(int, readline().split())) +    H = list(map(int, readline().split())) +    H.sort() +    if N <= K: +        ans = 0 +    else: +        ans = sum(H[: N - K]) +    print(ans) + + +if __name__ == "__main__": +    main()