#include <bits/stdc++.h>
using namespace std;
const int N = 500005;
const unsigned long long P = 20010425;
int n, l, r, mid, tag, ans;
bool b1[N], b2[N];
unsigned long long hs[N], p[N];
char s[N];
unsigned long long geths(int l, int r) {
  return hs[r] - hs[l - 1] * p[r - l + 1];
}
void init() {
  int i, j;
  for (i = 1; i <= n; i++) hs[i] = hs[i - 1] * P + s[i];
  p[0] = 1;
  for (i = 1; i <= n; i++) p[i] = p[i - 1] * P;
  for (i = 1; i <= n; i++)
    for (j = i + i; j <= n; j += i)
      if (geths(j - i + 1, j) == geths(1, i))
        b1[j] = 1;
      else
        break;
  for (i = 1; i <= n; i++)
    for (j = n - i - i + 1; j > 0; j -= i)
      if (geths(j, j + i - 1) == geths(n - i + 1, n))
        b2[j] = 1;
      else
        break;
}
int main() {
  int i;
  tag = 0;
  scanf("%s", s + 1);
  n = strlen(s + 1);
  for (i = 2; i <= n; i++)
    if (s[i] != s[1]) {
      tag = 1;
      break;
    }
  if (!tag) {
    printf("%d\n", n);
    printf("1\n");
    return 0;
  }
  init();
  if (!b1[n]) {
    printf("1\n");
    printf("1\n");
    return 0;
  }
  for (i = 1; i < n; i++)
    if (!b1[i] && !b2[i + 1]) ans++;
  printf("2\n");
  printf("%d\n", ans);
  return 0;
}
