Given a sequence of words, consisting of small Latin letters. Need to find the length of most words, occurring as a substring in each of the specified words.
The first line of the input file is a positive integer N (1 ≤ N ≤ 5), equal to the number of words. In each of the next N lines contains one word, made up of small letters of the alphabet. The word length of at least one character, and not more than 2000 characters.
The output file output one integer equal to the length of the largest word occurring as a substring in any of the words in the input file.