#include <bits/stdc++.h>
static const int MAXN = 5e5 + 4;
static const int HBASE1 = 983;
static const long long HMOD1 = 998244353;
static const int HBASE2 = 418;
static const long long HMOD2 = 1e9 + 7;
long long HBASE1_POW[MAXN], HBASE2_POW[MAXN];
int n;
char s[MAXN];
std::pair<long long, long long> h[MAXN];
inline std::pair<long long, long long> get_hash(int l, int r) {
  return std::pair<long long, long long>(
      (h[l].first - h[r + 1].first + HMOD1) * HBASE1_POW[n - r] % HMOD1,
      (h[l].second - h[r + 1].second + HMOD2) * HBASE2_POW[n - r] % HMOD2);
}
inline int period(int offset, int len) {
  static std::vector<int> div;
  div.clear();
  for (int i = 1; i * i <= len; ++i)
    if (len % i == 0) {
      div.push_back(i);
      if (i != 1 && i * i != len) div.push_back(len / i);
    }
  for (std::vector<int>::iterator d = div.begin(); d != div.end(); ++d) {
    if (get_hash(offset, offset + len - *d - 1) ==
        get_hash(offset + *d, offset + len - 1))
      return *d;
  }
  return len;
}
int main() {
  scanf("%s", s);
  n = strlen(s);
  HBASE1_POW[0] = HBASE2_POW[0] = 1;
  for (int i = 1; i <= n; ++i)
    HBASE1_POW[i] = HBASE1_POW[i - 1] * HBASE1 % HMOD1;
  for (int i = 1; i <= n; ++i)
    HBASE2_POW[i] = HBASE2_POW[i - 1] * HBASE2 % HMOD2;
  h[0] = std::pair<long long, long long>(0, 0);
  for (int i = 0; i < n; ++i) {
    h[i + 1] = std::pair<long long, long long>(
        (h[i].first + HBASE1_POW[i] * s[i]) % HMOD1,
        (h[i].second + HBASE2_POW[i] * s[i]) % HMOD2);
  }
  int p = period(0, n);
  if (p == 1) {
    printf("%d\n1\n", n);
  } else if (p == n) {
    printf("1\n1\n");
  } else {
    int ct = 0;
    for (int i = 1; i < n; ++i)
      if (period(0, i) == i && period(i, n - i) == n - i) ++ct;
    printf("2\n%d\n", ct);
  }
  return 0;
}
