def zeros(n: int) -> int:
    """Return the number of trailing zeros in the binary representation of n.
    Return 0 if n == 0."""

    result = 0
    while n & 1 == 0:
        n = n // 2
        result += 1
    return result