Problem C
Hraðskrif
Languages
en
is

Bjarki has prepared a dictionary on his computer that
contains all the words that may appear. For example, it takes
Given the text that Bjarki wants to write determine the maximum number of key presses saved.
Input
The first line of the input contains a single integer
Output
Print the maximum number of key presses Bjarki can save.
Scoring
Group |
Points |
Constraints |
1 |
30 |
|
2 |
40 |
Each word is at most |
3 |
30 |
No further constraints |
Sample Input 1 | Sample Output 1 |
---|---|
6 ANNA OG AMMA ETA MAT SAMAN |
7 |
Sample Input 2 | Sample Output 2 |
---|---|
7 BARBARA ARA BAR ARA ARABA BARA RABBABARA |
9 |
Sample Input 3 | Sample Output 3 |
---|---|
1 INSTANT |
6 |