#include <iostream>
#include <set>
using namespace std;
int main(void)
{
string S;
set<string> answer;
cin >> S;
for (int i = 0; i < S.length(); ++i)
{
string temp = "";
for (int j = i; j < S.length(); ++j)
{
temp += S[j];
answer.insert(temp);
}
}
cout << answer.size();
}
Coding/BaekJoon