#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < n; i++)
#define rep2(i, x, n) for(int i = x; i <= n; i++)
#define rep3(i, x, n) for(int i = x; i >= n; i--)
#define elif else if
#define sp(x) fixed << setprecision(x)
#define pb push_back
#define eb emplace_back
#define all(x) x.begin(), x.end()
#define sz(x) (int)x.size()
using ll = long long;
using ld = long double;
using pii = pair<int, int>;
using pil = pair<int, ll>;
using pli = pair<ll, int>;
using pll = pair<ll, ll>;
const ll MOD = 1e9+7;
//const ll MOD = 998244353;
const int inf = (1<<30)-1;
const ll INF = (1LL<<60)-1;
const ld EPS = 1e-10;
template<typename T> bool chmax(T &x, const T &y) {return (x < y)? (x = y, true) : false;};
template<typename T> bool chmin(T &x, const T &y) {return (x > y)? (x = y, true) : false;};

struct Suffix_Array{
    const string s;
    const int n;
    vector<int> sa;

    Suffix_Array(const string &str) : s(str+'$'), n(sz(s)){
        sa.resize(n);
        iota(all(sa), 0);
        sort(all(sa), [&](int a, int b){
            return s[a] == s[b] ? a > b : s[a] < s[b]; 
        });
        vector<int> rank(n), c(s.begin(), s.end()), cnt(n);
        for(int len = 1; len < n; len <<= 1){
            rep(i, n){
                if(i == 0 || c[sa[i-1]] != c[sa[i]]) rank[sa[i]] = i;
                else{
                    if(c[sa[i-1]+len/2] != c[sa[i]+len/2]) rank[sa[i]] = i;
                    else rank[sa[i]] = rank[sa[i-1]];
                }
            }
            iota(all(cnt), 0);
            copy(all(sa), c.begin());
            rep(i, n){
                int j = c[i]-len;
                if(j >= 0) sa[cnt[rank[j]]++] = j;
            }
            swap(rank, c);
        }
    }

    int operator [] (int i) const {return sa[i];}

    int size() const {return n;}
};

struct Longest_Common_Prefix_Array{
    const Suffix_Array sa;
    const int n;
    vector<int> lcp, ord;

    Longest_Common_Prefix_Array(const Suffix_Array &sa) : sa(sa), n(sa.size()-1){
        lcp.assign(n, 0), ord.assign(n+1, 0);
        lcp[0] = 0;
        rep(i, n+1) ord[sa[i]] = i;
        int h = 0;
        rep(i, n){
            int j = sa[ord[i]-1];
            if(h > 0) h--;
            while(max(i, j)+h < n && sa.s[i+h] == sa.s[j+h]) h++;
            lcp[ord[i]-1] = h;
        }
    }

    int operator [] (int i) const {return lcp[i];}
};

template<typename Semigroup>
struct Sparse_Table{
    Semigroup ope(Semigroup a, Semigroup b){
        return min(a, b);
    }
    const int n;
    vector<vector<Semigroup>> st;
    vector<int> lookup;

    Sparse_Table(const vector<Semigroup> &table) : n(sz(table)){
        st.resize(n);
        rep(i, n) st[i].pb(table[i]);
        for(int k = 0; (1<<k) < n; k++){
            rep(i, n){
                if(i+(1<<k) < n) st[i].pb(ope(st[i][k], st[i+(1<<k)][k]));
                else st[i].pb(st[i][k]);
            }
        }
        lookup.resize(n+1);
        lookup[0] = -1;
        rep2(i, 1, n) lookup[i] = lookup[i/2]+1;
    }

    Semigroup query(int l, int r){
        int k = lookup[r-l];
        return ope(st[l][k], st[r-(1<<k)][k]);
    }

    Semigroup operator [] (int i) {return st[i][0];}
};

int main(){
    string S;
    cin >> S;
    int N = sz(S);
    string T = S;
    reverse(all(T));
    Suffix_Array sa(S+char('a'-1)+T);
    int rank[2*N+2];
    rep(i, 2*N+2) rank[sa[i]] = i;
    Longest_Common_Prefix_Array lcp(sa);
    vector<int> table(2*N+1);
    rep(i, 2*N+1) table[i] = lcp[i];
    Sparse_Table<int> st(table);
    bool able[N+1];
    fill(able, able+N+1, true);
    rep2(i, 1, N){
        int l1 = rank[0], r1 = rank[i];
        if(l1 > r1) swap(l1, r1);
        int len1 = st.query(l1, r1);
        rep2(j, 2, len1/i+1) able[i*j] = false;
        int l2 = rank[N+1], r2 = rank[N+1+i];
        if(l2 > r2) swap(l2, r2);
        int len2 = st.query(l2, r2);
        rep2(j, 2, len2/i+1) able[N-i*j] = false;
    }
    int ans1, ans2;
    if(able[0]) ans1 = 1, ans2 = 1;
    else{
        ans1 = 2, ans2 = 0;
        rep2(i, 1, N) if(able[i]) ans2++;
        if(ans2 == 0) ans1 = N, ans2 = 1;
    }
    cout << ans1 << endl;
    cout << ans2 << endl;
}

Measured memory_bytes: 198240