시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 1024 MB18131168.750%

문제

Friends play an interesting game with words. The goal of this game is arranging words in pairs.

Friends have $n$ words of the same length. They are choosing the largest number $k$ such that it is possible to divide the words into pairs so that words in each pair have common prefix of length at least $k$.

Find the maximum possible value of $k$.

입력

The first line of input contains an even integer $n$ --- number of words ($1 \leq n \leq 2\cdot 10^5$).

The following $n$ lines contain words that the friends have. All words have same length. Total words length is less or equal to $2 \cdot 10^6$.

출력

Output maximal possible value of $k$.

예제 입력 1

4
aabc
aacc
bbbb
bbbd

예제 출력 1

2

예제 입력 2

2
a
b

예제 출력 2

0