def zeros(n):
    """Count the zeros to the right of the binary representation of n."""
    count = 0
    i = 0
    while True:
        v = (n >> i)
        if v <= 0:
            return count
        if v & 1:
            return count
        count += 1
        i += 1
    return count