#include<bits/stdc++.h>
#define rep(i, n) for(int i=0;i<(n);++i)
#define per(i, n) for(int i=(n)-1;i>=0;--i)
#define repa(i, n) for(int i=1;i<(n);++i)
#define foreach(i, n) for(auto &i:(n))
#define pii pair<int, int>
#define pll pair<long long, long long>
#define all(x) (x).begin(), (x).end()
#define bit(x) (1ll << (x))
using namespace std;
using ll = long long;
const ll MOD = (ll)1e9+7;
//const ll MOD = 998244353;
const int INF = (ll)1e9+7;
const ll INFLL = (ll)1e18;
using namespace std;
template<class t>
using vvector = vector<vector<t>>;
template<class t>
using vvvector = vector<vector<vector<t>>>;
template<class t>
using priority_queuer = priority_queue<t, vector<t>, greater<t>>;
template<class t, class u> bool chmax(t &a, u b){if(a<b){a=b;return true;}return false;}
template<class t, class u> bool chmin(t &a, u b){if(a>b){a=b;return true;}return false;}

#ifdef DEBUG
#define OUTPUT(x) (output(x), outendl())
#else
#define OUTPUT(x) (void)0
#endif

ll modpow(ll x, ll b){
	ll res = 1;
	while(b){
		if(b&1)res = res * x % MOD;
		x = x * x % MOD;
		b>>=1;
	}
	return res;
}

ll modinv(ll x){
	return modpow(x, MOD-2);
}

bool was_output = false;
template<class t>
void output(t a){
	if(was_output)cout << " ";
	cout << a;
	was_output = true;
}
void outendl(){
	was_output = false;
	cout << endl;
}


vector<int> make_primes(int MAX_NUM){
	vector<bool> flag(MAX_NUM+1, true);
	vector<int> res;
	for(int i=2;i<=MAX_NUM;++i){
		if(flag[i]){
			res.push_back(i);
			for(int j=i*2;j<=MAX_NUM;j+=i){
				flag[j] = false;
			}
		}
	}
	return res;
}
class z_algorithm {
public:
	vector< int > prefix;

	void build(const string &s)
	{
		prefix.assign(s.size(), 0);
		for(int i = 1, j = 0; i < (int)s.size(); i++) {
			if(i + prefix[i - j] < j + prefix[j]) {
				prefix[i] = prefix[i - j];
			} else {
				int k = max(0, j + prefix[j] - i);
				while(i + k < (int)s.size() && s[k] == s[i + k]) ++k;
				prefix[i] = k;
				j = i;
			}
		}
		prefix[0] = (int) s.size();
	}

	int operator[](const int k) const
	{
		return (prefix[k]);
	}

	size_t size()
	{
		return(prefix.size());
	}
};
string str;
z_algorithm front, back;
bool check(string str){
	int n = str.size();
	for(int i=2;i<n;++i){
		if(n%i!=0)continue;
		int d = n / i;
		bool flag = true;
		for(int j=d;j<n;j+=d){
			if(str.substr(0, d)!=str.substr(j, d)){
				flag = false;
				break;
			}
		}
		if(flag)return true;
	}
	return false;
}

bool check_front(int x){
	static vector<bool> memo;
	if(memo.empty()){
		int n = str.size();
		memo.resize(n+1, true);
		for(int i=1;i<n;++i){
			int j = i;
			while(true){
				if(j+i>n)break;
				if(i>front[j])break;
				memo[j+i] = false;
				j += i;
			}
		}
	}
	return !memo[x];
}

bool check_back(int x){
	static vector<bool> memo;
	if(memo.empty()){
		int n = str.size();
		memo.resize(n+1, true);
		for(int i=1;i<n;++i){
			int j = i;
			while(true){
				if(j+i>n)break;
				if(i>back[j])break;
				memo[j+i] = false;
				j += i;
			}
		}
	}
	return !memo[x];
}

bool allequal(string str){
	foreach(i, str){
		if(i!=str.front())return false;
	}
	return true;
}

int main(){
	cin >> str;
	int n = str.size();

	if(allequal(str)){
		cout << n << endl;
		cout << 1 << endl;
		return 0;
	}

	front.build(str);
	reverse(all(str));
	back.build(str);
	reverse(all(str));

	if(!check_front(n)){
		cout << 1 << endl;
		cout << 1 << endl;
		return 0;
	}

	int ans = 0;
	repa(i, n){
		if(check_front(i))continue;
		if(check_back(n-i))continue;
		++ans;
	}
	cout << 2 << endl;
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 4764