#include<bits/stdc++.h>

using namespace std;

vector<int> MP (string S) {
  vector<int> A(S.size() + 1);
  A[0] = -1;
  int j = -1;
  for(int i=0; i < (int) S.size() ; i++) {
    while (j >= 0 && S[i] != S[j]) j = A[j];
    j++;
    A[i+1] = j;
  }
  return A;
}

// shortest cycle length
vector<int> cycle(string S) {
  auto mp = MP(S);
  vector<int> A(S.size());
  for(int i = 0; i < (int) S.size() ; i++) {
    A[i] = i + 1 - mp[i + 1];
  }
  return A;
}

int main() {
  string s;
  cin >> s;
  string rev = s;
  reverse(begin(rev), end(rev));

  auto A = cycle(s);
  auto rA = cycle(rev);

  if(A.back() == 1) {
    cout << s.size() << endl << 1 << endl;
  } else if(A.back() != (int) s.size() && s.size() % A.back() == 0) {
    int ans = 0;
    for(int i = 0; i < (int) s.size()-1; i++) {
      int t = s.size() - 2 - i;
      if(A[i] != i+1 && (i+1) % A[i] == 0) continue;
      if(rA[t] != t+1 && (t+1) % rA[t] == 0) continue;
      ans++;
    }
    cout << 2 << endl;
    cout << ans << endl;
  } else {
    cout << 1 << endl << 1 << endl;
  }
}


