//KZNS
#include <fstream>
#include <cstring>
using namespace std;
//
ifstream fin ("trie.in");
ofstream fout ("trie.out");
//
int tr[40000][26] = {0};
int tru = 1;
//
int main() {
string s;
int t;
while (fin >> s) {
t = 0;
for (int i = 0; i < s.length(); i++) {
if (tr[t][s[i]-'A'])
t = tr[t][s[i]-'A'];
else
t = tr[t][s[i]-'A'] = tru++;
}
}
fout << tru << endl;
return 0;
}
//UBWH