#include <bits/stdc++.h>
using namespace std;
const long long base = 69;
const long long mod = 696969691;
long long n;
long long Tomori_chan[500005];
bool Isla_never_dies[500005];
long long mu[500005];
string s;
bool Isla_best_waifu[500005];
bool Tomori_second_best_waifu[500005];
bool match(long long i, long long j, long long len) {
  if (i > j) swap(i, j);
  if (((Tomori_chan[i + len - 1] - Tomori_chan[i - 1] + mod) % mod *
       mu[j - i]) %
          mod ==
      (Tomori_chan[j + len - 1] - Tomori_chan[j - 1] + mod) % mod)
    return true;
  return false;
}
signed main() {
  mu[0] = 1;
  for (long long i = 1; i <= 500000; i++) {
    mu[i] = (mu[i - 1] * base) % mod;
  }
  cin >> s;
  n = s.length();
  s = '!' + s;
  for (long long i = 1; i <= n; i++) {
    Tomori_chan[i] = Tomori_chan[i - 1] + s[i] * mu[i];
    Tomori_chan[i] %= mod;
  }
  bool dif = true;
  for (long long i = 2; i <= n; i++) {
    if (s[i] != s[i - 1]) {
      dif = false;
      break;
    }
  }
  if (dif) {
    cout << n - 1 << "\n" << 1;
    return 0;
  }
  for (long long i = 1; i <= n; i++) {
    for (long long j = 2 * i; j <= n; j += i) {
      if (match(j - i + 1, j - 2 * i + 1, i)) {
        Isla_best_waifu[j] = true;
      } else {
        break;
      }
    }
  }
  for (long long i = 1; i <= n; i++) {
    for (long long j = n + 1 - 2 * i; j >= 1; j -= i) {
      if (match(j, j + i, i)) {
        Tomori_second_best_waifu[j] = true;
      } else {
        break;
      }
    }
  }
  if (!Isla_best_waifu[n]) {
    cout << "1\n1";
    return 0;
  }
  long long ans = 0;
  for (long long i = 1; i < n; i++) {
    if (Isla_best_waifu[i] || Tomori_second_best_waifu[i + 1]) continue;
    ans++;
  }
  cout << 2 << endl << ans;
}
