#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <cmath>
using namespace std;
const int N=500010,Mo=1000000007;
int hs[N],d[N];
char s[N],s1[N],s2[N];
inline int query(int l,int r) {return (hs[r]-1LL*hs[l-1]*d[r-l+1]%Mo+Mo)%Mo;}
int main() {
    scanf("%s",s+1);
    int n=strlen(s+1),t=1,ans=0;
    for(int i=2;i<=n;i++) t&=(s[i]==s[i-1]);
    if(t) return cout<<n<<endl<<1,0;
    for(int i=d[0]=1;i<=n;i++) {
	d[i]=d[i-1]*19260817LL%Mo;
	hs[i]=(hs[i-1]*19260817LL+s[i])%Mo;
    }
    for(int i=1;i+i<=n;i++) {
	for(int j=i;j+i<=n;j+=i) {
	    if(query(1,i)!=query(j+1,j+i)) break;
	    s1[j+i]=1;
	}
	for(int j=n-i;j-i>=0;j-=i) {
	    if(query(n-i+1,n)!=query(j-i+1,j)) break;
	    s2[j-i]=1;
	}
    }
    if(!s1[n]) return cout<<1<<endl<<1,0;
    for(int i=1;i<n;i++)
	if(!s1[i]&&!s2[i]) ++ans;
    cout<<2<<endl<<ans;
    return 0;
}