#include <bits/stdc++.h>
using std::max;
using std::min;
using std::sort;
using std::swap;
template <typename T>
void read(T &x) {
  int flag = 1;
  x = 0;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') flag = -flag;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') x = x * 10 + ch - '0', ch = getchar();
  x *= flag;
}
const int _ = 5e5 + 10, P = 1e9 + 7;
int n, p[_], s[_];
char c[_];
int chk0(int r) {
  int len = r, now = len % (len - p[r]);
  if (!now) return len / (len - p[r]) == 1;
  return 1;
}
int chk1(int l) {
  int len = n - l + 1, now = len % (len - s[l]);
  if (!now) return len / (len - s[l]) == 1;
  return 1;
}
int main() {
  scanf("%s", c + 1), n = strlen(c + 1);
  for (int i = 2; i <= n; ++i) {
    int j = p[i - 1];
    while (j && c[j + 1] != c[i]) j = p[j];
    j += c[j + 1] == c[i], p[i] = j;
  }
  std::reverse(c + 1, c + n + 1);
  for (int i = 2; i <= n; ++i) {
    int j = s[i - 1];
    while (j && c[j + 1] != c[i]) j = s[j];
    j += c[j + 1] == c[i], s[i] = j;
  }
  std::reverse(s + 1, s + n + 1);
  std::reverse(c + 1, c + n + 1);
  int now = n - p[n];
  if (n % now == 0 && n / now == 1) return printf("%d\n%d\n", 1, 1), 0;
  if (now == 1) return printf("%d\n%d\n", n, 1), 0;
  printf("%d\n", 2);
  int ret = 0;
  for (int i = 1; i < n; ++i)
    if (chk0(i) && chk1(i + 1)) ++ret;
  printf("%d\n", ret);
  return 0;
}
