#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int ans = 0;
  char ch = getchar();
  while (!isdigit(ch)) ch = getchar();
  while (isdigit(ch)) ans = (ans << 3) + (ans << 1) + (ch ^ 48), ch = getchar();
  return ans;
}
char s[500005], t[500005];
int n, flag, pre[500005], suf[500005], ans = 0;
void getfail(int *fail, char *s) {
  fail[0] = -1;
  int j = 0;
  for (int i = 1; i < n; ++i) {
    while (j && s[i] != s[j]) j = fail[j];
    if (s[i] == s[j])
      fail[i + 1] = ++j;
    else
      fail[i + 1] = 0;
  }
}
inline bool checkpre(int pos) {
  return pre[pos] == 0 || pos % (pos - pre[pos]);
}
inline bool checksuf(int pos) {
  return suf[pos] == 0 || pos % (pos - suf[pos]);
}
int main() {
  scanf("%s", s), n = strlen(s);
  for (int i = 0; i < n; ++i) t[i] = s[n - i - 1];
  getfail(pre, s), getfail(suf, t), t[n] = '\0';
  flag = checkpre(n) ? 1 : 2;
  bool f = true;
  for (int i = 1; i < n; ++i)
    if (s[i] != s[i - 1]) {
      f = false;
      break;
    }
  if (f) flag = n;
  cout << flag << '\n';
  if (flag != 2) {
    cout << 1;
    return 0;
  }
  for (int i = 0; i < n; ++i) {
    int tmp = n - i - 1;
    if (checkpre(i + 1) && checksuf(tmp)) ++ans;
  }
  cout << ans;
  return 0;
}
