#include <bits/stdc++.h>
using namespace std;
string s[300005];
int main()
{
int n = 1;
while (cin >> s[n++])
;
sort(s + 1, s + n + 1);
int ans = 1;
for (int i = 1; i <= n; i++)
{
int j = 0;
for (; j < s[i].size() && j < s[i - 1].size(); j++)
if (s[i][j] != s[i - 1][j])
break;
// cout<<s[i].size()-j<<" ";
ans += s[i].size() - j;
}
cout << ans;
return 0;
}