#include <bits/stdc++.h>
using namespace std;
const int maxn=512345;
int n,nxt[maxn],pre[maxn];
char s[maxn];
int main()
{
    scanf("%s",s+1);
    n=strlen(s+1);
    for (int i=2;i<=n;++i) {
        int j=nxt[i-1];
        while (j&&s[i]!=s[j+1])
            j=nxt[j];
        nxt[i]=j+(s[i]==s[j+1]);
    }
    reverse(s+1,s+1+n);
    for (int i=2;i<=n;++i) {
        int j=pre[i-1];
        while (j&&s[i]!=s[j+1])
            j=pre[j];
        pre[i]=j+(s[i]==s[j+1]);
    }
    if (!nxt[n]||n%(n-nxt[n])) return 0*puts("1\n1");
    int res=0;
    for (int i=1;i<n;++i)
        if ((!nxt[i]||i%(i-nxt[i]))&&(!pre[n-i]||(n-i)%(n-i-pre[n-i]))) ++res;
    printf("%d\n%d\n",n/(n-nxt[n])==n?n:2,max(1,res));
    return 0;
}
