#include <bits/stdc++.h>
using namespace ::std;
const long long maxn = 5e5 + 9;
const long long inf = 1e9 + 500;
const long long mod = 1e9 + 7;
const long long rad = 5e5;
bool Gpr[maxn];
bool Gsa[maxn];
long long f[maxn];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  string s;
  cin >> s;
  long long n = s.size();
  bool e = 1;
  for (long long i = 1; i < n; i++) {
    if (s[i] != s[0]) e = 0;
  }
  if (e) {
    cout << n << '\n' << 1;
    return 0;
  }
  f[1] = 0;
  for (int i = 1; i < n; i++) {
    int state = f[i];
    while (state > 0 && s[state] != s[i]) state = f[state];
    if (s[state] == s[i]) state++;
    f[i + 1] = state;
  }
  for (long long i = 0; i < n; i++) {
    if (f[i + 1] * 2 < (i + 1) || (i + 1) % f[i + 1] != 0) {
      Gpr[i] = 1;
    }
  }
  reverse(s.begin(), s.end());
  f[1] = 0;
  for (int i = 1; i < n; i++) {
    int state = f[i];
    while (state > 0 && s[state] != s[i]) state = f[state];
    if (s[state] == s[i]) state++;
    f[i + 1] = state;
  }
  for (long long i = 0; i < n; i++) {
    if (f[i + 1] * 2 < (i + 1) || (i + 1) % f[i + 1] != 0) {
      Gsa[n - 1 - i] = 1;
    }
  }
  if (Gpr[n - 1]) {
    cout << 1 << '\n' << 1 << endl;
    return 0;
  }
  long long ans = 0;
  for (long long i = 0; i + 1 < n; i++) {
    if (Gpr[i] && Gsa[i + 1]) {
      ans++;
    }
  }
  if (ans == 0) {
    exit(1);
  }
  cout << 2 << '\n' << ans << endl;
}
