Longest common prefix

Time Limit : 2 Second

Memory Limit : 128 MB

Submission: 722

Solved: 137

Description


       Given N string S[1], S[2]......, S[N], you are to find a pair of strings whose longest common prefix has the largest length.


Input


       There are multiple test cases. For each case:



       The first line is a integer N. (2 <= N <= 20000)



       The next N lines each contains a non-empty string S[i]. The length of S[i] is at most 50.


Output


       For each case output a line representing the length of longest common prefix.


sample input
3
bcabc
bcd
abcd
sample output
2
hint
source
Xiaobin YANG
© 2015 HUST ACMICPC TEAM. All Right Reserved.