Repetition
Medium
Execution time limit is 1 second
Runtime memory usage limit is 64 megabytes
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.
Input
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.
Output
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.
Examples
Input #1
Answer #1
Submissions 724
Acceptance rate 10%