Given a list of strings, what is the longest substring common to all of them?
The first line of input contains an integer n (1≤n≤1,000), which is the number of strings that follow.
Each of the next n lines contains a single string s (1≤∣s∣≤100) consisting only of lower-case letters.
Output a single integer, which is the length of the longest substring common to all of the input strings.