def common_prefix_length(s, u):
    """Find length of longest common prefix of two sequences."""
    length = 0
    for cs, cu in zip(s, u):
        if cs != cu:
            break
        length += 1
    return length