#include <bits/stdc++.h>
using namespace std;
const int NUM = 1e5 + 5;
const int mod = 1e9 + 7;
int INF = 2e9;
pair<int, int> pinf = {INF, INF};
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  string s;
  cin >> s;
  int n = s.length();
  int z[n];
  z[0] = 0;
  int l = 0, r = 0;
  for (int i = 1; i < n; i++) {
    z[i] = 0;
    if (r >= i) z[i] = min(r - i + 1, z[i - l]);
    while (i + z[i] < n && s[i + z[i]] == s[z[i]]) z[i]++;
    if (i + z[i] - 1 > r) {
      l = i;
      r = i + z[i] - 1;
    }
  }
  int t = -1;
  for (int i = 1; i < n; i++)
    if (z[i] == n - i && n % i == 0) {
      t = i;
      break;
    }
  if (t == -1) {
    cout << 1 << endl << 1;
    return 0;
  }
  if (t == 1) {
    cout << n << endl << 1;
    return 0;
  }
  int ans = 0;
  int p[n], pr[n];
  p[0] = 0;
  pr[0] = 0;
  for (int i = 1; i < n; i++) {
    int k = p[i - 1];
    while (k != -1) {
      if (s[k + 1] == s[i + 1]) break;
      k = (k == 0 ? -1 : p[k - 1]);
    }
    p[i] = k + 1;
  }
  string sr;
  sr = s;
  for (int i = 0; i < n; i++) sr[i] = s[n - i - 1];
  for (int i = 1; i < n; i++) {
    int k = pr[i - 1];
    while (k != -1) {
      if (sr[k + 1] == sr[i + 1]) break;
      k = (k == 0 ? -1 : pr[k - 1]);
    }
    pr[i] = k + 1;
  }
  for (int i = 0; i < n - 1; i++)
    if ((2 * p[i] < i + 1 || (i + 1) % (i - p[i] + 1) != 0) &&
        (2 * pr[n - i - 2] < n - i - 1 ||
         (n - i - 1) % (n - i - 1 - pr[n - i - 2])))
      ans++;
  cout << 2 << endl << ans;
  return 0;
}
