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 words of the same length. They are choosing the largest number such that it is possible to divide the words into pairs so that words in each pair have common prefix of length at least .
Find the maximum possible value of .
입력
The first line of input contains an even integer --- number of words ().
The following lines contain words that the friends have. All words have same length. Total words length is less or equal to .
출력
Output maximal possible value of .