#include #include #include #include #include #include #include #include #include // complex a(1.2 , 2.3);// real(): 1.2, imag()2.3 using namespace std; #define MOD 1000000007 #define ll long long #define ld long double #define FOR(i,a,b) for(ll i=(ll)a;i<(ll)b;i++) #define rep(i,n) FOR(i,0,n) #define pb push_back #define mp make_pair #define all(a) a.begin(),a.end() #define rall(a) a.rbegin(),a.rend() #define rmsame(a) sort(all(a)),a.erase(unique(all(a)), a.end()) #define rmvector(a,b) rep(i,a.size())rep(j,b.size())if(a[i]==b[j]){a.erase(a.begin()+i);i--;break;} template bool exist(vector vec, X item){return find(all(vec), item)!=vec.end();} string S; ll dp[10005]={0}; ll solve(int no, string str){ if(str == "") return 0; ll ret = 0; for(ll i = 1;i<=str.size()/2;i++){ string sub1 = str.substr(0,i); string sub2 = str.substr(str.size()-i,i); if(sub1==sub2){ if(dp[i+no]!=0) ret += dp[i+no]; else { dp[i+no] = solve(no+i,str.substr(i, str.size()-i-i)); ret += dp[i+no]; } } } ret += 1; return ret; } int main(){ cin.tie(0); ios::sync_with_stdio(false); cin >> S; ll ans = solve(0,S); cout << ans << endl; //cout << fixed << setprecision(16) << ans << endl; return 0; }