#include <bits/stdc++.h>
using namespace std;
char s[500005];
int n, Pi1[500005], Pi2[500005];
void kmp(int* Pi) {
  int j = Pi1[0] = -1;
  for (int i = 0; i < n; i++) {
    while (~j && s[j] != s[i]) j = Pi1[j];
    Pi1[i + 1] = ++j;
  }
}
bool check(int a, int b) { return a % (a - b) || !b; }
int main() {
  scanf("%s", s);
  n = strlen(s);
  kmp(Pi1);
  if (check(n, Pi1[n])) {
    printf("1\n1\n");
    return 0;
  }
  if (n - Pi1[n] == 1) {
    printf("%d\n1\n", n);
    return 0;
  }
  reverse(s, s + n);
  kmp(Pi2);
  int ans = 0;
  for (int i = 1; i < n; i++)
    if (check(i, Pi1[i]) && check(n - i, Pi2[n - i])) ans++;
  printf("%d\n%d\n", 2, ans);
  return 0;
}
