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

int nt[5010000];
bool bl[5010000];

int main(){
	string s;cin>>s;
	nt[0]=-1;
	int k=-1,j=0;
	int l=s.size();
	if(l==1) cout<<1<<"\n"<<1<<"\n",exit(0);
	while(j<l){
		if(k==-1||s[j]==s[k]){
			j++;k++;
			if(s[j]!=s[k]) nt[j]=k;
			else nt[j]=nt[k];
		}
		else k=nt[k];
	}
	int xh=l-nt[l];
	//cout<<xh<<"\n";
	if(xh==1) 	cout<<l<<"\n"<<1<<"\n",exit(0);
	if(xh==l||l%xh!=0) cout<<1<<"\n"<<1<<"\n",exit(0);
	for(int i=0;i<l;i++){
		xh=i+1-nt[i+1];
		bl[i]=(xh!=i+1&&(i+1)%xh==0);
	}
	for(int i=0;i<l/2;++i){
		swap(s[i],s[l-1-i]);
	}
	memset(nt,-1,sizeof(nt));
	k=-1,j=0;
	while(j<l){
		if(k==-1||s[j]==s[k]){
			j++;k++;
			if(s[j]!=s[k]) nt[j]=k;
			else nt[j]=nt[k];
		}
		else k=nt[k];
	}
	int cnt=0;
	for(int i=0;i<l-1;i++){
		xh=i+1-nt[i+1];
		bool B=(xh!=i+1&&(i+1)%xh==0);
		if(B==0&&bl[l-2-i]==0) cnt++; 
	}
	cout<<2<<"\n"<<cnt<<"\n";
	return 0;
}