#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const double eps = 1e-6;
const int mod = 1000000007;
char s[500005];
int fail2[500005];
int fail1[500005], n;
bool all_same() {
  for (int i = 2; i <= n; i++)
    if (s[i - 1] != s[i]) return false;
  return true;
}
bool ok1(int l, int r) {
  int len = r - fail1[r];
  return (r - l + 1) % len != 0 || r - l + 1 == len;
}
bool ok2(int l, int r) {
  int len = fail2[l] - l;
  return (r - l + 1) % len != 0 || r - l + 1 == len;
}
int main() {
  scanf("%s", s + 1);
  n = strlen(s + 1);
  if (all_same()) {
    printf("%d\n%d\n", n, 1);
    return 0;
  }
  fail1[0] = -1;
  for (int i = 1, j = -1; i <= n; i++) {
    while (j >= 0 && s[i] != s[j + 1]) j = fail1[j];
    fail1[i] = ++j;
  }
  fail2[n + 1] = -1;
  for (int i = n, j = -1; i >= 1; i--) {
    while (j >= 0 && s[i] != s[j - 1]) j = fail2[j];
    fail2[i] = j--;
  }
  if (ok1(1, n)) {
    printf("1\n1\n");
    return 0;
  }
  printf("2\n");
  int cnt = 0;
  for (int cut = 1; cut < n; cut++) {
    if (ok1(1, cut) && ok2(cut + 1, n)) cnt++;
  }
  printf("%d\n", cnt);
  return 0;
}
