#include <bits/stdc++.h>
using namespace std;
const int N = 500010;
const int INF = 0x3f3f3f3f;
const int iinf = 1 << 30;
const long long linf = 2e18;
const int MOD = 1000000007;
const double eps = 1e-7;
void print(int x) {
  cout << x << endl;
  exit(0);
}
void PRINT(string x) {
  cout << x << endl;
  exit(0);
}
void douout(double x) { printf("%lf\n", x + 0.0000000001); }
char s[N];
int f[N], g[N], nxt[N];
int n, ans;
void work(int *f) {
  nxt[1] = 0;
  for (int i = 2, j = 0; i <= n; i++) {
    while (j && s[i] != s[j + 1]) j = nxt[j];
    if (s[i] == s[j + 1]) j++;
    nxt[i] = j;
  }
  for (int i = (1); i <= (n); i++)
    if (i % (i - nxt[i]) > 0 || nxt[i] == 0) f[i] = true;
}
signed main() {
  scanf("%s", s + 1);
  n = strlen(s + 1);
  work(f);
  reverse(s + 1, s + n + 1);
  work(g);
  if (f[n]) {
    printf("1\n1\n");
    return 0;
  }
  for (int i = (1); i <= (n); i++)
    if (f[i] && g[n - i]) ans++;
  if (ans == 0)
    printf("n\n1\n");
  else
    printf("2\n%d\n", ans);
  return 0;
}
