#include<bits/stdc++.h>
using namespace std;
#define sync ios_base::sync_with_stdio(false), cin.tie(NULL)
#define F first
#define S second
#define eb emplace_back
#define pb emplace_back
#define mt make_tuple
#define gcd __gcd
#define PI 3.141592653589
// Input
#define in(a) scanf("%d",&a)
#define in2(a,b) scanf("%d%d",&a,&b)
#define in3(a,b,c) scanf("%d%d%d",&a,&b,&c)
#define llin(a) cin >> a
#define inl(a) scanf("%lld",&a)
#define read(v,i,n) for(i=0;i<n;i++)in(v[i])
#define twod(mat,i,j,n,m) rep(i,n){rep(j,m)in(mat[i][j]);}
#define sc(ch) scanf("%c",&ch)
#define sstr(str) scanf("%s",str)
// Output
#define pr(a) printf("%d ",a)
#define pr2(a,b) printf("%d %d\n",a,b)
#define pr3(a,b,c) printf("%d %d %d\n",a,b,c)
#define out(a) printf("%d\n",a)
#define outl(a) printf("%lld\n",a)
#define llpr(a) cout << a << " "
#define llout(a) cout << a << "\n"
#define yes printf("YES\n")
#define no printf("NO\n")
#define lin printf("\n")
// Iterator
#define lp(i,a,b) for(i=a;i<b;i++)
#define rep(i,n) for(i=0;i<n;i++)
#define all(vec) vec.begin(),vec.end()
#define lower(v,k) lower_bound(v.begin(),v.end(),k)-v.begin()
#define upper(v,k) upper_bound(v.begin(),v.end(),k)-v.begin()
#define tf(mytuple) get<0>(mytuple)
#define ts(mytuple) get<1>(mytuple)
#define tt(mytuple) get<2>(mytuple)
// Debug
#define dbg(v,i,n) for(i=0;i<n;i++)pr(v[i]); lin
#define what(x) cerr << #x << " : " << x << "\n"
#define ck printf("continue\n")
#define debug(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args); }
void err(istream_iterator<string> it) {}
template<typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args)
{
	cerr << *it << " = " << a << "\n";
	err(++it, args...);
}
// Data Type
#define ll long long int
#define ii pair<int,int>
#define pli pair<ll,int>
#define triple tuple<int,int,int>
#define vi vector<int>
#define vii vector<pair<int,int> >
#define vvi vector<vector<int> >
#define viii vector<pair<pair<int,int>,int> >
#define vvii vector<vector<pair<int,int> > >
#define M 1000000007
#define P 3000  //check the limits, man
#define N 500005
const ll INF = 1e18;
int kmp[N];
void buildkmp(string str)
{
    int i,j,m;
    m=str.size();
    i=1,j=0;
    while(i<m)
    {
        if(str[j]==str[i])
            kmp[i++]=++j;
        else
        {
            if(j>0)
                j=kmp[j-1];
            else
                kmp[i++]=0;
        }
    }
    return ;
}
int Z[N];
string str;
int build()
{
    int n=str.size();
    fill(Z,Z+n,0);
    int L=0,R=0;
    int i,k;
    for(i=1;i<n;i++)
    {
        if(i>R)
        {
            L=i,R=i;
            while(R<n && str[R-L]==str[R])R++;
            Z[i]=R-L,R--;
        }
        else
        {
            k=i-L;
            if(Z[k]<R-i+1)
                Z[i]=Z[k];
            else
            {
                L=i;
                while(R<n && str[R-L]==str[R])R++;
                Z[i]=R-L,R--;
            }
        }
    }
    lp(i,1,n)
    {
        if(Z[i]==n-i && (n%i)==0)
            return i;
    }
    return n;
}
int main()
{
    llin(str);
    int n,p,i,x;
    p=build();
    n=str.size();
    if(p==1 || p==n)
    {
        out(n+1-p);
        out(1);
        return 0;
    }
    vi fward(n,1);
    vi bward(n,1);
    buildkmp(str);
    lp(i,1,n)
    {
        if(kmp[i]>0)
        {
            p=i+1-kmp[i];
            if((i+1)%p==0)
                fward[i]=0;
        }
    }
    reverse(all(str));
    fill(kmp,kmp+n,0);
    buildkmp(str);
    lp(i,1,n)
    {
        if(kmp[i]>0)
        {
            p=i+1-kmp[i];
            if((i+1)%p==0)
                bward[i]=0;
        }
    }
    reverse(all(bward));
    x=0;
    rep(i,n-1)
        if(fward[i] && bward[i+1])x++;
    out(2);
    out(x);
}





Measured memory_bytes: 9220