def trailing_zero_bits(mask):
    """Return a count of trailing zero bits in the mask."""
    mask_str = bin(mask)
    mask_len = len(mask_str)
    right_most_set_bit = mask_str.rfind('1')
    if right_most_set_bit > 0:
        return mask_len - right_most_set_bit - 1
    return mask_len
