Short code
Arcady's code consists of ( n ) variables, each with a unique name made up of lowercase English letters. One day, Arcady decided to simplify his code.
He aims to replace each variable's name with a non-empty prefix such that all new names are distinct from one another. Among all possible replacements, he wants to find the one that minimizes the total length of the variable names.
A string a is considered a prefix of string b if a can be obtained by removing zero or more characters from the end of b.
Determine the minimum possible total length of the new names.
Input
The first line contains a single integer ( n ) ((1 \leq n \leq 10^5)) – the number of variables.
The following ( n ) lines each contain a variable name, which is a non-empty string consisting only of lowercase English letters. The total length of all variable names combined does not exceed ( 2 \times 10^5 ). All variable names are distinct.
Output
Output a single integer representing the minimum possible total length of the new variable names.