시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 1024 MB147725654.902%

문제

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 \le n \le 1,000$), which is the number of strings that follow.

Each of the next $n$ lines contains a single string $s$ ($1 \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.

예제 입력 1

5
axabcrwmvd
abcn
tabchwqsl
bvrkabcayna
tyabc

예제 출력 1

3