Chain of words
A word chain of length n is defined as a sequence of words w_1, w_2, ..., w_n such that for each 1 ≤ i ≤ n, the word w_i is a proper prefix of the word w_{i+1}.
A word u of length k is considered a proper prefix of a word v of length l if l > k and the first k letters of v are identical to u.
Given a set of words S = {s1, s2, ..., sm}, determine the maximum length of a word chain that can be formed using some or all of the words from this set.
Input
The first line of the input contains an integer m (1 ≤ m ≤ 255). Each of the following m lines contains one word from the set S.
All words are non-empty, have a length of at most 255 characters, and consist solely of lowercase letters from the Latin alphabet.
Output
Write the solution to the problem in the output file.