// iostream is too mainstream
#include <cstdio>
// bitch please
#include <iostream>
#include <algorithm>
#include <cstdlib>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <list>
#include <cmath>
#include <iomanip>
#define dibs reserve
#define OVER9000 123456789012345678LL
#define ALL_THE(CAKE,LIE) for(auto LIE =CAKE.begin(); LIE != CAKE.end(); LIE++)
#define tisic 47
#define soclose 1e-8
#define chocolate win
// so much chocolate
#define patkan 9
#define ff first
#define ss second
#define abs(x) ((x < 0)?-(x):x)
#define uint unsigned int
#define dbl long double
using namespace std;
// mylittledoge
int main() {
cin.sync_with_stdio(0);
cin.tie(0);
string s;
cin >> s;
int N =s.length();
set< pair<long long, long long> > S[2000];
for(int a =1; a <= N; a++) for(int b =a+1; b <= N; b++) {
long long h1 =0, h2 =0;
int x =a, y =b, l =0;
while(x <= N) {
l++;
int a =s[x-1]-'a'+1;
if(s[x-1] >= '0' && s[x-1] <= '9') a =40+s[x-1]-'0';
if(s[x-1] >= 'A' && s[x-1] <= 'Z') a =60+s[x-1]-'A';
h1 =(h1*999983+a)%1000000009;
h2 =(h2*4521+a+2)%1000000007;
int z =x+y;
x =y;
y =z;}
S[l].insert(make_pair(h1,h2));}
int ans =0;
for(int i =0; i <= 1000; i++) ans +=S[i].size();
cout << ans << "\n";
return 0;}
// look at my code
// my code is amazing
Ly8gaW9zdHJlYW0gaXMgdG9vIG1haW5zdHJlYW0KI2luY2x1ZGUgPGNzdGRpbz4KLy8gYml0Y2ggcGxlYXNlCiNpbmNsdWRlIDxpb3N0cmVhbT4KI2luY2x1ZGUgPGFsZ29yaXRobT4KI2luY2x1ZGUgPGNzdGRsaWI+CiNpbmNsdWRlIDx2ZWN0b3I+CiNpbmNsdWRlIDxzZXQ+CiNpbmNsdWRlIDxtYXA+CiNpbmNsdWRlIDxxdWV1ZT4KI2luY2x1ZGUgPHN0YWNrPgojaW5jbHVkZSA8bGlzdD4KI2luY2x1ZGUgPGNtYXRoPgojaW5jbHVkZSA8aW9tY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