Jungyu wants to invent a new language called Jomal. First, Jungyu writes down a list of all the words that form the foundation of Jomal. Each word on this list is called a base word.
Using the base words, Jungyu now builds new words to complete the Grand Jomal Dictionary. A word appears in the Grand Jomal Dictionary if it satisfies at least one of the following conditions.
Determine how many distinct words the Grand Jomal Dictionary contains under this rule.
The first line contains the number of base words n (1 ≤ n ≤ 10 000). Each of the next n lines contains one base word. Every base word consists only of lowercase letters and has length between 1 and 40, inclusive.
Jungyu is lazy and did not check whether the list contains duplicate words, so the same word may appear several times; identical words are treated as one.
Print, on a single line, the number of distinct words in the Grand Jomal Dictionary.