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()

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()

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()

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()

-    input = sys.stdin.readline +    readline = sys.stdin.buffer.readline -    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) +    n, k = list(map(int, readline().split())) +    h = list(map(int, readline().split())) +    h.sort(reverse=True) +    print((sum(h[k:n])))