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

const int N=500100;
int f[N],g[N],n,ans;
char s[N],t[N];
void mp(char*s,int*f){
	f[0]=-1;
	for(int i=1,j=0;i<n;f[++i]=++j)
		for(;~j&&s[i]!=s[j];j=f[j]);
}

bool chk(int x,int*f){return !f[x]||x%(x-f[x]);}

int main(){
	ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
	cin>>s;n=strlen(s);
	for(int i=0;i<n;++i)t[i]=s[n-i-1];
	mp(s,f);mp(t,g);
	int all_same=1;
	for(int i=1;i<n;++i)if(s[i]!=s[0])all_same=0;
	if(all_same){
		cout<<n<<'\n'<<1<<'\n';
		return 0;
	}
	if(chk(n,f)){
		cout<<1<<'\n'<<1<<'\n';
		return 0;
	}
	for(int i=0;i<n;++i)
		if(chk(i+1,f)&&chk(n-i-1,g))++ans;
	cout<<2<<'\n'<<ans<<'\n';
	return 0;
}
