Given n keywords, count the number of distinct non-empty strings that occur as a prefix of at least one keyword (each keyword is a prefix of itself). Equivalently, this is the number of nodes, other than the root, in the trie built from the keywords.
Duplicate keywords contribute no new prefixes. All keywords consist of lowercase English letters only.
Input format
Line 1: an integer n.
Line 2: n space-separated keywords.
Output format
A single integer: the number of distinct non-empty prefixes.
Constraints
- 1 <= n <= 100000
- Each keyword has length 1..30, lowercase English letters.