Pick a Pair

아직 제출이 없습니다시간 제한1초메모리 제한1024 MB

문제

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

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

Find the maximum possible value of kk.

입력

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

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

출력

Output maximal possible value of kk.