#include <bits/stdc++.h>
using namespace std;
char ch[600100];
int z[600100], x, l, r, len, i;
int main() {
  scanf("%s", ch);
  len = strlen(ch);
  for (i = 1; i < len; i++) {
    if (i > r) {
      int now = 0;
      while (ch[now] == ch[now + i]) now++;
      z[i] = now;
      if (now) r = now + i - 1, l = i;
    } else {
      if (i + z[i - l] - 1 < r)
        z[i] = z[i - l];
      else {
        int now = 0;
        while (ch[now + r] == ch[now + r - l]) now++;
        z[i] = now + r - i;
        l = i;
        r = i + z[i] - 1;
      }
    }
  }
  for (i = len - 1; i >= 1; i--) {
    if (z[i] + i - 1 == len - 1) {
      int now = i - z[i];
      int f = 1;
      while (now >= 1) {
        if (z[now] + now == len)
          now -= z[i];
        else {
          f = 0;
          break;
        }
      }
      if (f && now == 0) {
        x = z[i];
        break;
      }
    }
  }
  if (x == 1)
    printf("%d\n1\n", len);
  else if (x == 0)
    printf("1\n1\n");
  else if (len / x == 2)
    printf("%d\n%d\n", 2, len / x * (x - 1));
  else
    printf("%d\n%d\n", 2, len / x * (x - 1));
  return 0;
}
