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

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

h.sort()

nokori = max(0, n - k)

h = h[:nokori]

print((sum(h)))

def main():

    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:])))



if __name__ == '__main__':

    main()
n, k = list(map(int, input().split()))
h = [int(i) for i in input().split()]
h.sort()
nokori = max(0, n - k)
h = h[:nokori]
print((sum(h)))

def main():
    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:])))


if __name__ == "__main__":
    main()

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