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≤n≤2⋅105).
The following n lines contain words that the friends have. All words have same length. Total words length is less or equal to 2⋅106.
Output maximal possible value of k.