#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
struct modint {
  long long val;
  modint() { val = 0; }
  modint(long long _val) { val = _val; }
};
modint operator+(modint p, modint q) { return modint((p.val + q.val) % MOD); }
modint operator-(modint p, modint q) {
  return modint((p.val - q.val + MOD) % MOD);
}
modint operator-(modint p) { return modint(0) - p; }
modint operator*(modint p, modint q) { return modint((p.val * q.val) % MOD); }
modint operator^(modint p, int q) {
  modint pows[30];
  pows[0] = p;
  for (int i = 1; i < 30; i++) {
    pows[i] = pows[i - 1] * pows[i - 1];
  }
  modint ans(1);
  for (int i = 0; i < 30; i++) {
    if (q & 1 << i) {
      ans = ans * pows[i];
    }
  }
  return ans;
}
modint operator/(modint p, modint q) { return p * (q ^ (MOD - 2)); }
bool operator==(modint p, modint q) { return p.val == q.val; }
const modint BASE(137);
const int MAX_N = 500005;
modint cumhash[MAX_N];
modint gethash(int l, int r) {
  if (l == 0) {
    return cumhash[r];
  } else {
    return (cumhash[r] - cumhash[l - 1]) / (BASE ^ l);
  }
}
bool splitpoint[MAX_N];
int main() {
  string str;
  cin >> str;
  modint hsh(0);
  for (int i = 0; i < (int)str.size(); i++) {
    hsh = hsh * BASE;
    hsh = hsh + modint(str[i]);
    cumhash[i] = hsh;
  }
  bool allSame = true;
  for (int i = 1; i < (int)str.size(); i++) {
    allSame &= (str[i] == str[0]);
  }
  if (allSame) {
    cout << (int)str.size() << endl << 1 << endl;
    return 0;
  }
  bool periodic = false;
  for (int i = 1; i < (int)str.size(); i++) {
    if ((int)str.size() % i == 0) {
      bool cur = true;
      modint periodhash = gethash(0, i - 1);
      for (int j = 0; j < (int)str.size(); j += i) {
        cur &= (gethash(j, j + i - 1) == periodhash);
      }
      periodic |= cur;
    }
  }
  if (!periodic) {
    cout << 1 << endl << 1 << endl;
    return 0;
  }
  fill(splitpoint, splitpoint + (int)str.size(), 1);
  for (int k = 1; 2 * k <= (int)str.size(); k++) {
    modint periodhash = gethash(0, k - 1);
    for (int i = k; i + k <= (int)str.size(); i += k) {
      if (gethash(i, i + k - 1) == periodhash) {
        splitpoint[i + k - 1] = 0;
      } else {
        break;
      }
    }
    modint revhash = gethash((int)str.size() - k, (int)str.size() - 1);
    for (int i = (int)str.size() - k - 1; i - k >= 0; i -= k) {
      if (gethash(i - k + 1, i) == revhash) {
        splitpoint[i - k] = 0;
      } else {
        break;
      }
    }
  }
  int ans = 0;
  for (int i = 0; i < (int)str.size() - 1; i++) {
    ans += splitpoint[i];
  }
  cout << 2 << endl << ans << endl;
}
