eolymp
bolt
Try our new interface for solving problems
Problems

Repetition

Repetition

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. \InputFile The first line of the input file is a positive integer \textbf{N} (\textbf{1} ≤ \textbf{N} ≤ \textbf{5}), equal to the number of words. In each of the next \textbf{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 \textbf{2000} characters. \OutputFile 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.
Time limit 1 second
Memory limit 64 MiB
Input example #1
5
abbbaabbaba
abbbabbbabbaaaaa
aaaaaaaabbaaaabaa
bbbbbabbabbbbb
aaaabbaaaa
Output example #1
4