#include <bits/stdc++.h>
using namespace std;
string s;
char buf[500010];
int fail1[500010], fail2[500010];
int n;
void getfail(string &s, int *fail) {
  fail[0] = -1;
  int j = -1;
  for (int i = 1; i <= n; i++) {
    while (~j && s[j] != s[i - 1]) j = fail[j];
    fail[i] = ++j;
  }
}
int main() {
  scanf("%s", buf), s = buf;
  n = s.length();
  getfail(s, fail1);
  int len =
      n % (n - fail1[n]) == 0 && (n - fail1[n] <= n / 2) ? n - fail1[n] : -1;
  if (len == -1) {
    printf("1\n1\n");
    return 0;
  }
  if (len == 1) {
    printf("%d\n1\n", n);
    return 0;
  }
  printf("2\n");
  reverse(s.begin(), s.end());
  getfail(s, fail2);
  int ans = 0;
  for (int i = 2; i < n - 1; i++) {
    if ((!fail1[i] || i % (i - fail1[i])) &&
        (!fail2[n - i] || (n - i) % ((n - i) - fail2[n - i])))
      ans++;
  }
  printf("%d\n", ans + 2);
  return 0;
}
