#include <bits/stdc++.h>
using namespace std;
const long long N = 1e5 + 10;
const long long MOD = 1e9 + 7;
long long n;
long long has[N], powe[N];
bool pre[N], suff[N];
string s;
long long getm(long long l, long long r) {
  long long res = (has[r] - has[l - 1] * powe[r - l + 1] * 1ll + MOD) % MOD;
  return res;
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> s;
  char rem = s[0];
  bool flag = false;
  for (long long i = 0; i < s.length(); ++i)
    if (s[i] != rem) flag = true;
  if (!flag) {
    cout << s.length() << '\n' << "1";
    return 0;
  }
  for (long long i = 1; i <= s.length(); ++i)
    has[i] = (has[i - 1] * 26 + s[i - 1] - 'a') % MOD;
  powe[0] = 1ll;
  for (long long i = 1; i <= s.length(); ++i) powe[i] = powe[i - 1] * 26 % MOD;
  for (long long i = 1; i <= s.length(); ++i)
    if (!pre[i]) {
      long long cur = getm(1, i);
      for (long long idem = 2; i * idem <= s.length(); ++idem) {
        long long tmp = getm(i * idem - i + 1, i * idem);
        if (tmp != cur) break;
        pre[idem * i] = true;
      }
    }
  for (long long i = s.length(); i >= 1; --i) {
    long long cur = getm(i, s.length());
    long long dem = s.length() - i + 1;
    for (long long idem = 2; idem * dem <= s.length(); ++idem) {
      long long tmp =
          getm(s.length() - i * idem + 1, s.length() - i * (idem - 1));
      if (tmp == cur)
        suff[i * idem] = true;
      else
        break;
    }
  }
  if (pre[s.length()] == false) {
    cout << "1\n1";
  } else {
    cout << "2\n";
    long long idem = 0;
    for (long long i = 1; i < s.length(); ++i)
      if (pre[i] == false && suff[i + 1] == false) idem++;
    cout << idem;
  }
}
