Micro has an array $$A$$ having $$N$$ strings made of lower case English alphabets. He is interested in finding out the length of the longest string that occurs as a substring among all the strings in $$A$$.
Now as you know strings hate Micro, so he asked Monk for help. Since Monk is busy organizing Code Monk, he assigned this task to you.
First line consists of a single integer denoting $$N$$.
Each of the following $$N$$ lines consists of a single string made of lower case English alphabets.
Print the length of the longest common substring among all strings in $$A$$.
$$ 1 \le N \le 10^6 $$
$$ 1 \le |A[i]| \le 10^6 $$
The sum of lengths of all Strings in $$A$$ shall not exceed $$10^6$$
String "cd" is the longest string that occurs as a substring in all the strings of array.