#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e11;
string txt;
const long long P1 = 39;
long long P[500010], hsh[500010];
int n;
bool prefij[500010], sufij[500010];
const long long MOD = (1LL << 31) - 1;
long long gethash(int pos, int delta) {
  int iz, der;
  if (delta < 0) {
    der = pos;
    iz = pos + delta + 1;
  } else {
    der = pos + delta - 1;
    iz = pos;
  }
  return ((hsh[iz] - hsh[der + 1] * P[abs(delta)]) % MOD + MOD) % MOD;
}
bool go(int pos, int delta) {
  set<long long> s;
  for (int i = pos; i < n & i >= 0; i += delta) {
    s.insert(gethash(i, delta));
    if (s.size() > 1) return 0;
  }
  return 1;
}
int main() {
  cin >> txt;
  long long antP = 1, anthsh = 0;
  set<char> s;
  hsh[txt.size()] = 0;
  P[0] = 1;
  for (int i = txt.size() - 1; i >= 0; i--) {
    P[txt.size() - i] = (antP * P1) % MOD;
    antP = P[txt.size() - i];
    hsh[i] = ((txt[i] - 'a' + 1) + anthsh * P1) % MOD;
    anthsh = hsh[i];
    s.insert(txt[i]);
  }
  if (s.size() == 1) {
    cout << txt.size() << "\n1\n";
    return 0;
  }
  n = txt.size();
  for (long long delta = 1; delta < n; delta++) {
    for (int j = delta + delta - 1; j < n; j += delta) {
      prefij[j] |= go(j, -delta);
      sufij[n - j - 1] = go(n - j - 1, delta);
    }
  }
  int c = 0;
  for (long long i = 0; i < n; i++) {
    if (prefij[i] == 0 && sufij[i + 1] == 0) {
      c++;
    }
  }
  if (sufij[0] != 0)
    cout << "2\n" << c << endl;
  else
    cout << "1\n1\n";
}
