#include <iostream>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <cstring>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <bitset>
#include <numeric>
#include <utility>
#include <iomanip>
#include <algorithm>
#include <functional>
using namespace std;

#define COUT(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl
#define EACH(i, s) for (__typeof__((s).begin()) i = (s).begin(); i != (s).end(); ++i)

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
template<class T1, class T2> ostream& operator << (ostream &s, pair<T1,T2> P)
{ return s << '<' << P.first << ", " << P.second << '>'; }
template<class T> ostream& operator << (ostream &s, vector<T> P)
{ for (int i = 0; i < P.size(); ++i) { if (i > 0) { s << " "; } s << P[i]; } return s; }
template<class T> ostream& operator << (ostream &s, vector<vector<T> > P)
{ for (int i = 0; i < P.size(); ++i) { s << endl << P[i]; } return s << endl; }
template<class T1, class T2> ostream& operator << (ostream &s, map<T1,T2> P)
{ EACH(it, P) { s << "<" << it->first << "->" << it->second << "> "; } return s << endl; }


vector<int> divisor(int n) {
    vector<int> res;
    for (int i = 1LL; i*i <= n; ++i) {
        if (n%i == 0LL) {
            res.push_back(i);
            int temp = n/i;
            if (i != temp) res.push_back(temp);
        }
    }
    sort(res.begin(), res.end());
    return res;
}

string str;






// Suffix Array ( Manber&Myers: O(n (logn)^2) )
// 160830(ARC060 F)
struct SuffixArray {
    static const int MAX_S = 550000;
    string str;
    int sa[MAX_S];          // sa[i] : the starting index of the i-th smallest suffix (i = 0, 1, ..., n)
    vector<int> lcp;        // lcp[i]: the lcp of sa[i] and sa[i+1] (i = 0, 1, ..., n-1)
    inline int& operator [] (int i) {return sa[i];}
    
    // build SA
    int rank_sa[MAX_S];
    int tmp_rank_sa[MAX_S];
    struct CompareSA {
        int n, k;
        int *rank;
        CompareSA(int n, int k, int* rank_sa) : n(n), k(k), rank(rank_sa) {}
        bool operator()(int i, int j) {
            if (rank[i] != rank[j]) return (rank[i] < rank[j]);
            else {
                int rank_ik = (i + k <= n ? rank[i + k] : -1);
                int rank_jk = (j + k <= n ? rank[j + k] : -1);
                return (rank_ik < rank_jk);
            }
        }
    };
    void buildSA() {
        int n = (int)str.size();
        for (int i = 0; i < n; ++i) sa[i] = i, rank_sa[i] = (int)str[i];
        sa[n] = n, rank_sa[n] = -1;
        for (int k = 1; k <= n; k *= 2) {
            CompareSA csa(n, k, rank_sa);
            sort(sa, sa + n + 1, csa);
            tmp_rank_sa[sa[0]] = 0;
            for (int i = 1; i <= n; ++i) {
                tmp_rank_sa[sa[i]] = tmp_rank_sa[sa[i - 1]];
                if (csa(sa[i - 1], sa[i])) ++tmp_rank_sa[sa[i]];
            }
            for (int i = 0; i <= n; ++i) rank_sa[i] = tmp_rank_sa[i];
        }
    }
    
    // build LCP
    static const int INF = 1<<29;
    struct SparseTable {
        static const int LOG_MAX_S = 21;
        int st[LOG_MAX_S][MAX_S];
        int ln[MAX_S];
        
        void init(const vector<int> &vec) {
            for (int i = 0; i < MAX_S; ++i) {
                st[0][i] = INF;
                int ti = i, tln = 0;
                while (ti > 0) ti /= 2, ++tln;
                ln[i] = tln - 1;
            }
            for (int i = 0; i < vec.size(); ++i) st[0][i] = vec[i];
            for (int i = 1; i < LOG_MAX_S; ++i) {
                for (int j = 0; j < MAX_S; ++j) {
                    st[i][j] = min(st[i-1][j], st[i-1][j + (1<<(i-1))]);
                }
            }
        }
        
        // [a, b)
        int get(int a, int b) {
            if (a >= b) return INF;
            int bet = b - a, row = ln[bet];
            return min(st[row][a], st[row][b - (1<<row)]);
        }
    } st;
    int rsa[MAX_S];
    void calcLCP() {
        int n = (int)str.size();
        for (int i = 0; i <= n; ++i) rsa[sa[i]] = i;
        lcp.resize(n + 1);
        lcp[0] = 0;
        int cur = 0;
        for (int i = 0; i < n; ++i) {
            int pi = sa[rsa[i] - 1];
            if (cur > 0) --cur;
            for (; pi + cur < n && i + cur < n; ++cur) {
                if (str[pi + cur] != str[i + cur]) break;
            }
            lcp[rsa[i] - 1] = cur;
        }
        st.init(lcp);
    }
    int getLCP(int a, int b) {          // lcp of str.sutstr(a) and str.substr(b)
        return st.get(min(rsa[a], rsa[b]), max(rsa[a], rsa[b]));
    }
    
    // sa
    void init(const string& str_) {
        str = str_;
        buildSA();
        calcLCP();
    }
    
} sa;



bool cannot_cut[SuffixArray::MAX_S];


int main() {
    while (cin >> str) {
        int n = str.size();
        vector<int> divs = divisor(n);
        int syu = n;
        for (int i = 0; i < divs.size(); ++i) {
            int d = divs[i];
            bool ok = true;
            for (int j = 0; j + d < n; ++j) {
                if (str[j] != str[j+d]) {
                    ok = false;
                }
            }
            if (ok) {
                chmin(syu, d);
            }
        }
        if (syu == n) cout << 1 << endl << 1 << endl;
        else if (syu == 1) cout << n << endl << 1 << endl;
        else {
            memset(cannot_cut, 0, sizeof(cannot_cut));
            sa.init(str);
            for (int d = 1; d < n; ++d) {
                for (int dd = d; dd < n; dd += d) {
                    int lcp = sa.getLCP(0, dd);
                    if (lcp < d) break;
                    cannot_cut[dd + d] = true;
                }
                for (int dd = n-d*2; dd >= 0; dd -= d) {
                    int lcp = sa.getLCP(dd, n-d);
                    if (lcp < d) break;
                    cannot_cut[dd] = true;
                }
            }
            int con = 0;
            for (int i = 1; i < n; ++i) if (!cannot_cut[i]) ++con;
            cout << 2 << endl << con << endl;
        }
    }
}




Measured memory_bytes: 58884