#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 10;
int pre[N], n, sub[N];
char s[N], t[N];
bool chkpre(int x) { return x % (x - pre[x]) > 0 || !pre[x]; }
bool chksub(int x) { return x % (x - sub[x]) > 0 || !sub[x]; }
void getfail(char *s, int *nxt) {
  nxt[0] = nxt[1] = 10;
  int j = 0;
  for (int i = 1; i <= n - 1; i++) {
    while (j && s[i] != s[j]) j = nxt[j];
    nxt[i + 1] = (s[i] == s[j] ? ++j : 0);
  }
}
int main() {
  scanf("%s", s);
  n = strlen(s);
  for (int i = 0; i <= n - 1; i++) t[i] = s[n - i - 1];
  t[n] = '\0';
  getfail(s, pre), getfail(t, sub);
  int flag = chkpre(n) ? 1 : 2;
  if (n - pre[n] == 1) flag = n;
  printf("%d\n", flag);
  if (flag != 2) {
    puts("1");
    return 0;
  }
  int ans = 0;
  for (int i = 1; i <= n; i++) {
    int x = n - i;
    if (chkpre(i) && chksub(x)) ans++;
  }
  printf("%d\n", ans);
  return 0;
}
