#include<bits/stdc++.h>
#define REP(i,x,y) for(ll i=x; i<=y; i++)
#define BIT(t) ((long long 1) << t)
#define PER(i,y,x) for(ll i=y; i>=x; i--)
#define vll vector<ll>
#define vvll vector<vector<ll>>
#define pll pair<ll,ll>
#define SIZE(v) ll(v.size())
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() );
using namespace std;
typedef long long ll;

ll MOD = (1ll << 61) - 1;
ll BIT31 = (1ll << 31) - 1;
ll BIT30 = (1ll << 30) - 1;

ll mod_p(ll x,ll y){
        return (x + y + MOD) % MOD;
}
ll mod_m(ll x,ll y){
        ll xd = x & BIT31;
        ll xu = (x >> 31);
        ll yd = y & BIT31;
        ll yu = (y >> 31);
        ll mid = xu * yd + yu * xd;
        ll midd = mid & BIT30;
        ll midu = (mid >> 30);
        ll tmp = midu + (midd << 31);
        return ((xu * yu * 2) % MOD + tmp % MOD + xd * yd % MOD) % MOD;
}

ll mod_pow(ll x, ll t){
        if(t == 0) {
                return 1;
        }else if(t % 2 == 0){
                ll tmp = mod_pow(x, t/2);
                return mod_m(tmp, tmp);
        }else{
                ll tmp = mod_pow(x, t/2);
                return mod_m(mod_m(tmp, tmp), x);
        }
}

ll mod_inv(ll x){
        return mod_pow(x, MOD - 2);
}

vll basepow(1e6+1);
vll basepowinv(1e6+1);

ll BASE_VAL;
void init_base(){
        srand((unsigned int)time(NULL));
        BASE_VAL = rand();
        basepow[0] = basepowinv[0] = 1;
        basepow[1] = BASE_VAL;
        basepowinv[1] = mod_inv(BASE_VAL);
        REP(i,2,1e6){
                basepow[i] = mod_m(basepow[i-1], basepow[1]);
                basepowinv[i] = mod_m(basepowinv[i-1], basepowinv[1]);
        }
}

vll f(string s){
        vll ans;
        ll n = s.size();
        vll ms(n+1);
        ms[0] = 0;
        REP(i,1,n){
                ms[i] = mod_p(ms[i-1], mod_m(s[i-1] - 'a' + 1, basepow[i]));
        }
        REP(i,1,n){
                ll cur = i;
                ll tmp = ms[i];
                while(cur + i<= n){
                        ll nx = mod_m(mod_p(ms[cur + i], -ms[cur]), basepowinv[cur]);
                        cur += i;
                        if(tmp == nx){
                                ans.push_back(cur);
                        }else{
                                break;
                        }
                }
        }
        return ans;
}

int main(){
        init_base();
        string s;
        cin >> s;
        ll n = s.size();
        bool flag = 1;
        REP(i,0,n - 2){
                if(s[i] != s[i+1]){
                        flag = 0;
                }
        }
        if(flag){
                cout << n << endl << 1 << endl;
                return 0;
        }
        bool flag2 = 1;
        REP(i,1,n-1){
                if(n % i == 0){
                        bool flagi = 1; //i次の悪い文字列かどうか
                        REP(j,0,n-1-i){
                                if(s[j] != s[j+i]){
                                        flagi = 0;
                                }
                        }
                        if(flagi){
                                flag2 = 0;
                                break;
                        }
                }
        }
        if(flag2){
                cout << 1 << endl << 1 << endl;
                return 0;
        }        
        vll v1 = f(s);
        reverse(s.begin(), s.end());
        vll v2 = f(s);
        REP(i,0,SIZE(v2)-1){
                v2[i] = n - v2[i];
        }
        vll anss(n+1, 1);
        for(auto x:v1){
                anss[x] = 0;
        }
        for(auto x:v2){
                anss[x] = 0;
        }
        ll ans = 0;
        REP(i,1,n){
                ans += anss[i];
        }
        cout << 2 << endl << ans << endl;
}

Measured memory_bytes: 94904