def count_unset_bits(n):
    if n == 0:
        return 1

    binary = bin(n)[2:]
    return binary.count("0")