/*

                   _ooOoo_
                  o8888888o
                  88" . "88
                  (| -_- |)
                  O\  =  /O
               ____/`---'\____
             .'  \\|     |//  `.
            /  \\|||  :  |||//  \
           /  _||||| -:- |||||-  \
           |   | \\\  -  /// |   |
           | \_|  ''\---/''  |   |
           \  .-\__  `-`  ___/-. /
         ___`. .'  /--.--\  `. . __
      ."" '<  `.___\_<|>_/___.'  >'"".
     | | :  `- \`.;`\ _ /`;.`/ - ` : | |
     \  \ `-.   \_ __\ /__ _/   .-` /  /
======`-.____`-.___\_____/___.-`____.-'======
                   `=---='
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                    prayer
*/

// g++ -std=c++11 a.cpp
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>	
#include<map>
#include<set>
#include<unordered_map>
#include<utility>
#include<cmath>
#include<random>
#include<cstring>
#include<queue>
#include<stack>
#include<bitset>
#include<cstdio>
#include<sstream>
#include<iomanip>
#include<assert.h>
#include<typeinfo>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define FOR(i,a) for(auto i:a)
#define pb push_back
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)
#define show1d(v) rep(_,v.size())cout<<" "<<v[_];cout<<endl;
#define show2d(v) rep(__,v.size()){rep(_,v[__].size())cout<<" "<<v[__][_];cout<<endl;}
using namespace std;
//kaewasuretyuui
typedef long long ll;
#define int ll
typedef int Def;
typedef pair<Def,Def> pii;
typedef vector<Def> vi;
typedef vector<vi> vvi;
typedef vector<pii> vp;
typedef vector<vp> vvp;
typedef vector<string> vs;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef pair<Def,pii> pip;
typedef vector<pip>vip;
// #define mt make_tuple
// typedef tuple<int,int,int> tp;
// typedef vector<tp> vt;
template<typename A,typename B>bool cmin(A &a,const B &b){return a>b?(a=b,true):false;}
template<typename A,typename B>bool cmax(A &a,const B &b){return a<b?(a=b,true):false;}
//template<class C>constexpr int size(const C &c){return (int)c.size();}
//template<class T,size_t N> constexpr int size(const T (&xs)[N])noexcept{return (int)N;}
const double PI=acos(-1);
const double EPS=1e-9;
Def inf = sizeof(Def) == sizeof(long long) ? 2e18 : 1e9+10;
int dx[]={0,1,0,-1};
int dy[]={1,0,-1,0};

// Rolling Hash
// long long にして使うこと
class RHash{
	public:
	int n;
	vi base,mo;//mod
	vvi hash;
	vvi po;//pow
	
	RHash(string s){
		base={1009,9973};
		mo={1000000007,1000000009};
		
		n=s.size();
		hash=vvi(n+1,vi(2));
		po=vvi(n+1,vi(2,1));
		
		rep(i,n)rep(j,2){
			hash[i+1][j]=(hash[i][j]+s[i])*base[j]%mo[j];
			po[i+1][j]=po[i][j]*base[j]%mo[j];
		}
	}
	pii get(int l,int r){// [l,r)
		Def t[2];
		rep(i,2)t[i]=((hash[r][i]-hash[l][i]*po[r-l][i])%mo[i]+mo[i])%mo[i];
		return {t[0],t[1]};
	}
};
vi f(string s){
	RHash rh(s);
	int n=s.size();
	vi h(n+1);
	loop(i,1,n){
		pii t=rh.get(0,i);
		for(int j=i;j+i<=n;j+=i){
			pii nt=rh.get(j,j+i);
			if(t.first==nt.first&&t.second==nt.second)h[j+i]=1;
			else break;
		}
	}
	return h;
}
signed main(){
	string s;
	cin>>s;
	int n=s.size();
	bool h=true;
	rep(i,s.size()-1)if(s[i]-s[i+1])h=false;
	if(h){
		cout<<n<<endl;
		cout<<1<<endl;
		return 0;
	}
	vi a=f(s);
	reverse(all(s));
	vi b=f(s);
	
	if(!a[n])cout<<1<<endl<<1<<endl;
	else{
		int co=0;
		loop(i,1,n)if(!a[i]&&!b[n-i])co++;
		
		assert(co);
		cout<<2<<endl<<co<<endl;
	}
	
}















Measured memory_bytes: 65820