One day, Little A received several strings, but he did not know the specific meanings of these strings. To uncover the mystery, he decided to start with the essentially different suffixes of the strings and calculate some interesting information.
A suffix of a string is a segment that starts from a certain position and goes to the end. For example, the suffixes of the string abc include: abc, bc, c.
He wants to know how many essentially different suffixes there are.
The first line contains a positive integer $$$N$$$ $$$(1 \leq N \leq 3 \times 10^5)$$$, indicating the number of strings received by Little A.
The next $$$N$$$ lines each contain a string $$$S_i$$$ composed of lowercase English letters, representing one of the strings received by Little A.
It is guaranteed that $$$\sum |S_i| \leq 3 \times 10^5$$$.
Output a single line containing an integer that represents the number of essentially different suffixes.
3fbudpefscfhjoofsedpouftu
22
| Name |
|---|


