#include <iostream>
#include <algorithm>

#define rep(i, n) for(int i = 0; i < (n); ++i)

using namespace std;

int n;
string w;
int z[500000];
bool s[500000];
bool t[500000];

void nt(bool* s){
	z[0] = n;
	int i = 1;
	int j = 0;
	while(i < n){
		for(; i + j < n && w[i + j] == w[j]; ++j){}
		z[i] = j;
		if(j == 0){
			++i;
			continue;
		}
		int k = 1;
		for(; k < j && k + z[k] < j; ++k){
			z[i + k] = z[k];
		}
		i += k;
		j -= k;
	}

	fill_n(s, n, true);
	rep(i, n - 1){
		if(s[i]){
			for(int j = i * 2 + 1; j <= i + z[i + 1]; j += i + 1){
				s[j] = false;
			}
		}
	}
}

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

	nt(s);
	reverse(w.begin(), w.end());
	nt(t);

	int u, v = 0;
	if(s[n - 1]){
		u = 1;
		v = 1;
	}
	else if(z[1] == n - 1){
		u = n;
		v = 1;
	}
	else{
		u = 2;
		rep(i, n - 1){
			if(s[i] && t[n - i - 2]){
				++v;
			}
		}
	}
	cout << u << endl;
	cout << v << endl;
	return 0;
}