Longest Common Substring

아직 제출이 없습니다시간 제한1초메모리 제한1024 MB

문제

Given a list of strings, what is the longest substring common to all of them?

입력

The first line of input contains an integer nn (1n1,0001 \le n \le 1,000), which is the number of strings that follow.

Each of the next nn lines contains a single string ss (1s1001 \le |s| \le 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.