A word chain of length is defined as a sequence of words w_1, w_2, \ldots, w_n such that for every 1 \leq i < n, the word w_i is a proper prefix of the word w_{i+1}.
Recall that a word of length is called a proper prefix of a word of length if l > k and the first letters of are the same as .
Given a set of words S = \{s_1, s_2, \ldots, s_m\}, find the maximum length of a word chain that can be formed using some (possibly not all) words from this set.
The first line contains an integer (1 \leq m \leq 255). Each of the next lines contains one word from the set .
All words are non-empty, have length at most , and consist only of lowercase Latin letters.
Output the answer to the problem.
Example 1