#include <bits/stdc++.h>
using namespace std;

const int mod = 1000000007;
const int P = 3232323;

long long h[500010], power[500010];
char buf[500010];
int bad1[500010], bad2[500010];

string read(){scanf("%s", buf); return buf;}

long long get_h(int l, int r){return (h[r] - h[l - 1] * power[r - l + 1] % mod + mod) % mod;}

int main(){
	string s = read(); s = " " + s;
	int n = s.length() - 1;
	power[0] = 1;
	for (int i = 1; i <= n; i++){
		power[i] = power[i - 1] * P % mod;
		h[i] = (h[i - 1] * P % mod + s[i] - 'a' + 1) % mod;
	}
	int minpd;
	for (int i = 1; i <= n; i++){
		if (n % i) continue;
		if (get_h(1, n - i) == get_h(1 + i, n)){
			minpd = i;
			break;
		}
	}
	if (minpd == n){
		printf("1\n1\n");
		return 0;
	}
	if (minpd == 1){
		printf("%d\n1\n", n);
		return 0;
	}
	for (int i = 1; i <= n; i++){
		long long a = get_h(1, i);
		for (int j = 2 * i; j <= n; j += i){
			if (get_h(j - i + 1, j) != a) break;
			bad1[j] = 1;
		}
	}
	for (int i = 1; i <= n; i++){
		long long a = get_h(n - i + 1, n);
		for (int j = n - 2 * i + 1; j >= 1; j -= i){
			if (get_h(j, j + i - 1) != a) break;
			bad2[j] = 1;
		}
	}
	int ans = 0;
	for (int i = 2; i <= n; i++){
		if (!bad1[i - 1] && !bad2[i]) ans++;
	}
	printf("2\n%d\n", ans);
	return 0;
}
