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



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



if len(h) <= k:

    print((0))

else:

    sorted_h = sorted(h, reverse=True)

    print((sum(sorted_h[k:])))
def find_minimum_normal_attack(monster_num, special_move_num, monster_healths):

    return sum(sorted(monster_healths, reverse=True)[special_move_num:])





if __name__ == '__main__':

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

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

    print((find_minimum_normal_attack(n, k, h)))

n, k = list(map(int, input().split()))
h = [int(x) for x in input().split()]
if len(h) <= k:
    print((0))
else:
    sorted_h = sorted(h, reverse=True)
    print((sum(sorted_h[k:])))

def find_minimum_normal_attack(monster_num, special_move_num, monster_healths):
    return sum(sorted(monster_healths, reverse=True)[special_move_num:])


if __name__ == "__main__":
    n, k = list(map(int, input().split()))
    h = list(map(int, input().split()))
    print((find_minimum_normal_attack(n, k, h)))

-n, k = list(map(int, input().split())) -h = [int(x) for x in input().split()] -if len(h) <= k: -    print((0)) -else: -    sorted_h = sorted(h, reverse=True) -    print((sum(sorted_h[k:]))) +def find_minimum_normal_attack(monster_num, special_move_num, monster_healths): +    return sum(sorted(monster_healths, reverse=True)[special_move_num:]) + + +if __name__ == "__main__": +    n, k = list(map(int, input().split())) +    h = list(map(int, input().split())) +    print((find_minimum_normal_attack(n, k, h)))