#pragma GCC optimize("Ofast")
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>

#define F first
#define S second
#define int long long
#define ll long long
//#define int  unsigned long long
#define pb push_back
//#define double long double

using namespace std;
using namespace __gnu_pbds;
typedef  tree< int , null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
const int mod = 1e9 + 7;
const int N = 500005;
const int K = 20;
int p[2][N], suf[N], h[N][4], y[5], sum[5], val[5];
bool ok(string s){
    int n = s.length();
    if (n == 1) return 1;
    for (int i = 1; i < n; i++){
        if (n % i == 0){
            string q = s.substr(0, i);
            string z = q;
            for (int j = 1; j < n / i; j++){
                z += q;
            }
            if (z == s) return 0;
        }
    }
    return 1;
}
bool prime(int x){
    if (x == 1) return 0;
    for (int i = 2; i * i <= x; i++){
        if (x % i == 0) return 0;
    }
    return 1;
}
int binpow(int x, int y, int mod){
   // cout << x << " " << y << " " << mod << endl;
    if (y == 0) return 1;
    if (y % 2) return x * binpow(x, y - 1, mod) % mod;
    int z = binpow(x, y / 2, mod);
    return z * z % mod;
}
void calc(string s, int k){
    string t = s;
    int n = s.length();
    if (k == 1){
        for (int i = 0; i < n; i++){
            t[i] = s[n - i - 1];
        }
    }
    int b = 400 + rand() % 30000;
    vector < int > pr;
    int l = 1e9 + 1e7;
    for (int i = l; pr.size() < 1; i++){
        if (prime(i)) pr.pb(i);
    }
    for (int i = 0; i < n; i++){
        for (int j = 0; j < pr.size(); j++){
            h[i + 1][j] = (h[i][j] * b + t[i]) % pr[j];
        }
    }
    for (int i = 1; i <= n; i++) p[k][i] = 1;
    for (int i = 1; i < n; i++){
      //  cout << i << endl;
        for (int l = 0; l < pr.size(); l++){
            y[l] = binpow(b, i, pr[l]);
            val[l] = y[l];
            sum[l] = 1;
        }
        for (int j = 2 * i; j <= n; j += i){
            for (int l = 0; l < pr.size(); l++){
                sum[l] = (sum[l] + val[l]) % pr[l];
                val[l] = val[l] * y[l] % pr[l];
                if (p[k][j] == 0) continue;
                if (p[k][j - i] == 1 && j != 2 * i) continue;
                int x = (h[j][l] - y[l] * h[j - i][l] % pr[l] + pr[l]) % pr[l];
                int v3 = x * sum[l] % pr[l];
                if (v3 == h[j][l]){
                    p[k][j] = 0;
                    break;
                }
            }
        }
    }
}
main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    //freopen("input.txt", "r", stdin);
    string s;
    cin >> s;
    set < int > t;
    int n = s.length();
    for (int i = 0; i < n; i++){
        t.insert(s[i]);
    }
    if (t.size() == 1){
        cout << n << endl;
        cout << 1 << endl;
        return 0;
    }
    if (ok(s)){
        cout << 1 << endl;
        cout << 1 << endl;
        return 0;
    }
    int ans = 0;
    calc(s, 0);
    calc(s, 1);
    for (int i = 1; i <= n - 1; i++){
        if (p[0][i] && p[1][n - i]){
            ans++;
        }
    }
    cout << 2 << endl;
    cout << ans;
}


Measured memory_bytes: 27412