#include <bits/stdc++.h>
#define FAST_READ ios_base::sync_with_stdio(0);/*cin.tie(0); cout.tie(0);*/
#define ll long long
#define endl "\n"
#define MAXN 200010
using namespace std;
string stroka;
map<string,ll>nuj;
ll cnt=0;
int main(){
FAST_READ;
cin>>stroka;
ll n=stroka.size();
for (ll i=0;i<n;i++)
for (ll len=1; len<=n-i;len++)
if(nuj[stroka.substr(i,len)]!=1)
{
cnt++;
nuj[stroka.substr(i,len)]=1;
}
cout<<nuj.size()<<endl;
return 0;
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CiNkZWZpbmUgRkFTVF9SRUFEIGlvc19iYXNlOjpzeW5jX3dpdGhfc3RkaW8oMCk7LypjaW4udGllKDApOyBjb3V0LnRpZSgwKTsqLwojZGVmaW5lIGxsIGxvbmcgbG9uZwojZGVmaW5lIGVuZGwgIlxuIgojZGVmaW5lIE1BWE4gMjAwMDEwCgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKCgpzdHJpbmcgc3Ryb2thOwptYXA8c3RyaW5nLGxsPm51ajsKbGwgY250PTA7CmludCBtYWluKCl7CkZBU1RfUkVBRDsKY2luPj5zdHJva2E7CmxsIG49c3Ryb2thLnNpemUoKTsKZm9yIChsbCBpPTA7aTxuO2krKykgCmZvciAobGwgbGVuPTE7IGxlbjw9bi1pO2xlbisrKQppZihudWpbc3Ryb2thLnN1YnN0cihpLGxlbildIT0xKQp7CiAgY250Kys7CiAgbnVqW3N0cm9rYS5zdWJzdHIoaSxsZW4pXT0xOwp9Cgpjb3V0PDxudWouc2l6ZSgpPDxlbmRsOwpyZXR1cm4gMDsKfSA=