def common_prefix_len(a: str, b: str) -> int:
    """ Find the common prefix of two strings. """
    min_len = min(len(a), len(b))
    for i in range(min(len(a), len(b))):
        if a[i] != b[i]:
            return i
    return min_len