#include <bits/stdc++.h>
#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define FORR(i,a,b) for (int i=(a);i>=(b);i--)
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define pcnt __builtin_popcount
#define sz(x) (int)(x).size()
#define maxs(x,y) x = max(x,y)
#define mins(x,y) x = min(x,y)
#define show(x) cout<<#x<<" = "<<x<<endl;
#define rng(a) (a.begin()),(a.end())
#define each(it,c) for(__typeof((c).begin()) it=(c).begin();it!=(c).end();it++)

using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<pii> vpii;
typedef set<int> si;
typedef pair<ll,ll> pll;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<pll> vpll;
typedef set<ll> sl;
typedef __int128_t lll;
typedef pair<lll,lll> plll;
typedef vector<lll> vlll;
template<typename T>string join(vector<T>&v){stringstream s;FOR(i,0,sz(v))s<<' '<<v[i];return s.str().substr(1);}
template<typename A,size_t N,typename T>void Fill(A (&array)[N],const T&v){fill((T*)array,(T*)(array+N),v);}
lll gcd(lll a,lll b,lll &x,lll &y){if(!b){x=1;y=0;return a;}lll d=gcd(b,a%b,y,x);y-=a/b*x;return d;}
ll gcd(ll a,ll b){lll x=0,y=0;return gcd(a,b,x,y);}
ll modpow(lll a,lll n,ll m){if(!a)return a;lll p=1;for(;n>0;n>>=1,a=a*a%m)if(n&1)p=p*a%m;return(ll)p;}
bool isprime(ll n){if(n<2)return 0;if(!(n%2))return !(n-2);lll d=n-1,t,y;while(!(d%2))d>>=1;vl al={2,325,9375,28178,450775,9780504,1795265022};for(ll a:al){if(n<=a)break;t=d,y=modpow(a,t,n);while(t!=n-1&&y!=1&&y!=n-1)y=y*y%n,t<<=1;if(y!=n-1&&!(t%2))return 0;}return 1;}
void dout(double d){printf("%.12f\n",d);}
void YN(bool z){cout<<(z?"YES\n":"NO\n");}
void Yn(bool z){cout<<(z?"Yes\n":"No\n");}
void yn(bool z){cout<<(z?"yes\n":"no\n");}
const int iinf = 1e9+6;
const ll linf = 1e18;
//const int mod = 1e9+7;
const double pi = acos(-1);
const double eps = 1e-10;

const int N = 5e5+1;
constexpr ll mod = 397530691357530971;
lll p[N], h[N];
string s;
struct Prime{
  vector<ll> pl;
  void init(int a){ // a以下の素数列挙
    pl.resize(0);
    vector<bool> z(a+1, true);
    FOR(i, 2, a+1){
      if(z[i])pl.push_back(i);
      for(int b=i*2; b <= a; b+=i) z[b]=false;
    }
  }
  void divisor(ll a, vector<ll>&v){ // v に約数が入る
    v.resize(0);
    v.push_back(1);
    for(ll b: pl){
      if(b*b > a) break;
      if(a%b) continue;
      int l=0, vs=v.size();
      while(a%b==0){
        a /= b;
        FORR(i, v.size()-1, l) v.push_back(v[i] * b);
        l += vs;
      }
    }
    if(a>1) FORR(i, v.size()-1, 0) v.push_back(v[i] * a);
    sort(v.begin(), v.end());
  }
} pr;
vl v;
bool z[26];
vector<bool> vz1, vz2;
int ans;

main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  p[0] = 1;
  FOR(i, 1, N) p[i] = p[i-1] * 27 % mod;
  pr.init(1000);
  cin >> s;
  ll l = sz(s);
  FOR(i, 0, l){
    h[i+1] = (h[i] * 27 + s[i]-'`') % mod;
    z[s[i]-'a'] = true;
  }
  {
    int c = 0;
    FOR(i, 0, 26) if(z[i]) c++;
    if (c == 1){
      cout << l << endl << 1 << endl;
      return 0;
    }
  }
  pr.divisor(l, v);
  each(itr, v){
    ll d = *itr;
    if(d==l){
      cout << 1 << endl << 1 << endl;
      return 0;
    }
    if(d == 1) continue;
    for(ll i = 0; i < l; i += d) if (h[i+d] != (h[d]+h[i]*p[d])%mod) goto bad;
    vz1.assign(l+1, true);
    FOR(i, 1, l/2+1)if(vz1[i])for(int j=2*i; j<=l; j+=i){
      if((h[j-i]*p[i]+h[i])%mod != h[j]) break;
      vz1[j] = false;
    }
    vz2.assign(l+1, true);
    FOR(i, 1, l/2+1)if(vz2[l-i])for(int j=2*i; j<=l; j+=i){
      lll ddd = (h[l]-h[l-i]*p[i]%mod+mod)%mod;
      if((h[l-j]*p[i]+ddd)%mod != h[l-j+i]) break;
      vz2[l-j] = false;
    }
    FOR(i, 0, l+1) if(vz1[i] && vz2[i]) ans++;
    cout << 2 << endl << ans << endl;
    return 0;
bad: ;
  }
}

Measured memory_bytes: 16540