# include <bits/stdc++.h>
 
/*
// ordered_set 
# include <ext/pb_ds/assoc_container.hpp>
# include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
# define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update> 
*/
 
using namespace std;
 
typedef long long                                        ll;
typedef long double                                      ld;
typedef pair <int, int>                                  pii;
typedef pair <pii, int>                                  ppi;
typedef pair <int, pii>                                  pip;
typedef pair <pii, pii>                                  ppp;
typedef pair <ll, ll>                                    pll;
 
# define A                                               first
# define B                                               second
# define endl                                            '\n'
# define sep                                             ' '
# define all(x)                                          x.begin(), x.end()
# define kill(x)                                         return cout << x << endl, 0
# define SZ(x)                                           int(x.size())
# define Sort(x)                                         sort(all(x))
# define InTheNameOfGod                                  ios::sync_with_stdio(0);cin.tie(0); cout.tie(0);
 
ll power(ll a, ll b, ll md) {return (!b ? 1 : (b & 1 ? a * power(a * a % md, b / 2, md) % md : power(a * a % md, b / 2, md) % md));}
 
const int xn = 5e5 + 10;
const int xm = - 20 + 10;
const int SQ = 320;
const int sq = 320 + 10;
const int inf = 1e9 + 10;
const ll INF = 1e18 + 10;
const int mod[3] = {1000000007, 1000000009, 998244353};
const int TM = 3;
const int base = 257;

ll n, ans, pw[3][xn], inv[3][xn], Inv[3], part[3][xn], dp[2][xn];
string s;
bool flag[2][xn];

ll get(int l, int r, int ind){ return ((part[ind][r] - part[ind][l - 1] + mod[ind]) % mod[ind]) * inv[ind][l] % mod[ind];}
bool check(int l1, int r1, int l2, int r2){
	bool fl1 = true;
	for (int j = 0; j < 3; ++ j) fl1 &= (get(l1, r1, j) == get(l2, r2, j));
	return fl1;
}

int main(){
    InTheNameOfGod;
    
	cin >> s;
	n = s.size();
	s = '.' + s;
	for (int j = 0; j < 3; ++ j) pw[j][0] = inv[j][0] = 1;
	for (int j = 0; j < 3; ++ j) Inv[j] = power(base, mod[j] - 2, mod[j]);
	for (int j = 0; j < 3; ++ j){
		for (int i = 1; i <= n; ++ i){
			pw[j][i] = pw[j][i - 1] * base % mod[j];
			inv[j][i] = inv[j][i - 1] * Inv[j] % mod[j];
			part[j][i] = (part[j][i - 1] + (s[i] - 'a') * pw[j][i] % mod[j]) % mod[j];
		}
	}
	for (int i = 1; i <= n; ++ i){
		dp[0][i] = i;
		dp[1][n - i + 1] = i;
		for (int j = i + i; j <= n; j += i){
			if (dp[0][j - i] == i && check(j - i + 1, j, j - i - i + 1, j - i)) dp[0][j] = i;
			flag[0][j] |= (dp[0][j] == i);
			int ind = n - j + 1;
			if (dp[1][ind + i] == i && check(ind, ind + i - 1, ind + i, ind + i + i - 1)) dp[1][ind] = i;
			flag[1][ind] |= (dp[1][ind] == i);
		}
		if (i == 1 && dp[0][n] == 1){
			cout << n << endl << 1 << endl;
			return 0;
		}
	}
	if (!flag[0][n]){
		cout << 1 << endl << 1 << endl;
		return 0;
	}
	cout << 2 << endl;
	for (int i = 1; i < n; ++ i) ans += (!flag[0][i] && !flag[1][i + 1]);
	cout << ans << endl;

    return 0;
}


Measured memory_bytes: 47908