#include <cstdio>
#include <cstring>
#include <algorithm>
#define R register
using namespace std;
const int MAXN=500100;
int next1[MAXN],next2[MAXN];
char s1[MAXN],s2[MAXN];

int reads(char *st)
{
	int len=0;char ch=getchar();
	while(ch<'a'||ch>'z')ch=getchar();
	while(ch>='a'&&ch<='z')st[++len]=ch,ch=getchar();
	return len;
}

void getnext(char *st,int *next,int len)
{
	int j=0;
	for(int i=2;i<=len;++i)
	{
		while(j&&st[i]!=st[j+1])j=next[j];
		if(st[i]==st[j+1])++j;
		next[i]=j;
	}
}

int main()
{
	int n=reads(s1);
	for(R int i=1;i<=n;++i)s2[i]=s1[n-i+1];
	getnext(s1,next1,n);
	getnext(s2,next2,n);
	int t=n-next1[n];
	if(t==1){printf("%d\n1\n",n);}
	else if(t<n&&n%t==0)
	{
		puts("2");
		int ans=0;
		for(int i=1;i<n;++i)
		{
			int t1=i-next1[i],t2=n-i-next2[n-i];
			if(t1<i&&i%t1==0)continue;
			if(t2<n-i&&(n-i)%t2==0)continue;
			++ans;
		}
		printf("%d\n",ans);
	}
	else puts("1\n1");
	return 0;
}