L. Ledger of true names
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

In the ruined observatory above the dead city, Racso and Christian copy out the Ledger of True Names.

A true name is power: speak one and the thing it belongs to must answer. But a name spoken alone burns the speaker, so the old sorcerers bound names in pairs, sealing each pair under a single sigil. The binding holds only if the two names begin the same way, and the sigil's power is exactly the length of that shared beginning.

The brothers have $$$N$$$ true names before them and one night of candlelight. Find the power of the strongest sigil they can seal — the longest beginning shared by two different names in the Ledger.

Input

The first line contains a single integer $$$N$$$ $$$(2 \le N \le 10^5)$$$ — the number of true names in the Ledger.

Each of the next $$$N$$$ lines contains one true name $$$s_i$$$, a non-empty string of lowercase Latin letters with $$$|s_i| \le 50$$$.

It is guaranteed that the sum of $$$|s_i|$$$ over all names does not exceed $$$10^5$$$. Names are not necessarily distinct.

Output

Print a single integer: the power of the strongest sigil, or $$$0$$$ if no two names in the Ledger even begin with the same letter.

Examples
Input
5
racso
rascal
christian
christ
chris
Output
6
Input
3
umbra
umbra
sol
Output
5
Note

Two names $$$s$$$ and $$$t$$$ share a beginning of length $$$\ell$$$ if $$$s_1 = t_1$$$, $$$s_2 = t_2$$$, $$$\ldots$$$, $$$s_\ell = t_\ell$$$.

Two entries of the Ledger are always considered different if they sit at different positions in the input, even when their names are identical: two entries reading umbra share a beginning of length $$$5$$$.