#include<bits/stdc++.h>
using namespace std;
using Int = signed;

struct FastIO{
  FastIO(){
    cin.tie(0);
    ios::sync_with_stdio(0);
  }
}fastio_beet;


template<typename T1,typename T2> inline void chmin(T1 &a,T2 b){if(a>b) a=b;}
template<typename T1,typename T2> inline void chmax(T1 &a,T2 b){if(a<b) a=b;}


template<typename T>
struct SparseTable{
  using F = function<T(T,T)>;
  vector<vector<T> > dat;
  vector<Int> ht;
  F f;
  
  SparseTable(){}
  SparseTable(Int n,F f):f(f){init(n);}
  
  void init(Int n){
    Int h=1;
    while((1<<h)<n) h++;
    dat.assign(h,vector<T>(n));
    ht.assign(n+1,0);
    for(Int j=2;j<=n;j++) ht[j]=ht[j>>1]+1;
  }
  
  void build(Int n,vector<T> &v){
    Int h=1;
    while((1<<h)<n) h++;
    for(Int j=0;j<n;j++) dat[0][j]=v[j];
    for(Int i=1,p=1;i<h;i++,p<<=1)
      for(Int j=0;j<n;j++)
        dat[i][j]=f(dat[i-1][j],dat[i-1][min(j+p,n-1)]);
  };

  T query(Int a,Int b){
    if(a>b) swap(a,b);
    Int l=b-a;
    return f(dat[ht[l]][a],dat[ht[l]][b-(1<<ht[l])]);
  }
};


struct SuffixArray{
  Int n,k;
  string S;
  vector<Int> sa,lcp;
  SuffixArray(){}
  SuffixArray(string& S):S(S){init();}
  void init(){
    n=S.length();
    S.push_back('$');
    build_sa();
    build_lcp();
    build_rmq();
  }
  void build_sa(){
    sa.clear();
    sa.resize(n+1,0);
    iota(sa.begin(),sa.end(),0);
    sort(sa.begin(),sa.end(),
	 [&](Int a,Int b){
	   if(S[a]==S[b]) return a>b;
	   return S[a]<S[b];
	 });
    vector<Int> c(n+1,0),r(n+1),cnt(n+1),s(n+1);
    for(Int i=0;i<=n;i++) r[i]=S[i];
    for(Int len=1;len<=n;len*=2){
      for(Int i=0;i<=n;i++){
	 c[sa[i]]=
	   i>0 &&
	   r[sa[i-1]]==r[sa[i]] &&
	   sa[i-1]+len<=n &&
	   r[sa[i-1]+len/2]==r[sa[i]+len/2] ?
	   c[sa[i-1]]:i;
      }
      iota(cnt.begin(),cnt.end(),0);
      copy(sa.begin(),sa.end(),r.begin());
      for(Int i=0;i<=n;i++){
	Int s1=r[i]-len;
	if(s1>=0) sa[cnt[c[s1]]++]=s1;
      }
      c.swap(r);
    }
  }
  
  bool lt_substr(string &T,Int si=0,Int ti=0){
    Int sn=S.size(),tn=T.size();
    while(si<sn&&ti<tn){
      if(S[si]<T[ti]) return 1;
      if(S[si]>T[ti]) return 0;
      si++;ti++;
    }
    return si>=sn&&ti<tn;
  }
  
  Int lower_bound(string& T){
    Int low=0,high=n+1;
    while(low+1<high){
      Int mid=(low+high)/2;
      if(lt_substr(T,sa[mid],0)) low=mid;
      else high=mid;
    }
    return high;
  }
  
  Int upper_bound(string& T){
    T.back()++;
    Int res=lower_bound(T);
    T.back()--;
    return res;
  }
  
  // O(|T|*log|S|)
  Int count(string& T){
    return upper_bound(T)-lower_bound(T);
  }
  
  void build_lcp(){
    lcp.clear();
    lcp.resize(n+1,0);
    vector<Int> r2(n+1);
    for(Int i=0;i<=n;i++) r2[sa[i]]=i;
    Int h=0;
    lcp[0]=0;
    for(Int i=0;i<n;i++){
      Int j=sa[r2[i]-1];
      if(h>0) h--;
      for(;j+h<n&&i+h<n;h++){
	if(S[j+h]!=S[i+h]) break;
      }
      lcp[r2[i]-1]=h;
    }
  }
  
  Int getlcp(Int p,string &T,Int d){
    Int i=0;
    Int len=min((Int)T.length()-d,(Int)S.length()-p-d);
    while(i<len&&S[p+d+i]==T[d+i]) i++;
    return i;
  }
  
  SparseTable<Int> rmq;
  void build_rmq(){
    rmq.init(n+1);
    rmq.f=[](Int a,Int b){return min(a,b);};
    rmq.build(n+1,lcp);
  }
  
};


//INSERT ABOVE HERE
signed main(){
  string s;
  cin>>s;
  Int n=s.size();
  {
    string t(s);
    t.erase(unique(t.begin(),t.end()),t.end());
    if(t.size()==1u){
      cout<<n<<endl<<1<<endl;
      return 0;
    }
  }

  assert(n!=1);
  
  vector<vector<Int> > v(n+1);
  for(Int i=1;i<=n;i++)
    for(Int j=i+i;j<=n;j+=i)
      v[j].emplace_back(i);

  SuffixArray sa(s);
  vector<Int> rev(n+1);
  for(Int i=0;i<=n;i++) rev[sa.sa[i]]=i;
  auto check=[&](Int l,Int r)->Int{    
    for(Int x:v[r-l])
      if(sa.rmq.query(rev[l],rev[l+x])>=r-l-x) return 0;
    return 1;
  };
  
  if(check(0,n)){
    cout<<1<<endl<<1<<endl;
    return 0;
  }

  //assert(0);
  assert(check(0,n-1));
  cout<<2<<endl;
  
  Int ans=0;
  for(Int i=1;i<n;i++)
    ans+=check(0,i)&&check(i,n);
  
  cout<<ans<<endl;
  return 0;
}


Measured memory_bytes: 101792