#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];
int n, a[500005];
unsigned long long mul[500005], hashh[500005];
inline bool check(int len, int dis) {
  int l = 1, r = len;
  if (dis == len) return false;
  for (; l <= dis && r <= dis; l += len, r += len)
    if (hashh[r] - hashh[l - 1] != hashh[len] * mul[l - 1]) return false;
  return true;
}
inline int calc(int len) {
  int ret = n / len * (len - 1);
  if (n & 1) return ret;
  if (check(len, n / 2)) return ret;
  return ret + 1;
}
inline int delta(int a, int b) { return a / (b - 1) * (b - 1) - 1; }
int main() {
  scanf("%s", s + 1), n = strlen(s + 1);
  for (int i = 1; i <= n; ++i) a[i] = s[i] - 'a';
  int cnt = 1;
  for (int i = 2; i <= n; ++i)
    if (a[i] != a[i - 1])
      break;
    else
      ++cnt;
  if (cnt == n) {
    printf("%d\n1", n);
    return 0;
  }
  mul[0] = 1;
  for (int i = 1; i <= n; ++i) mul[i] = mul[i - 1] * 37;
  for (int i = 1; i <= n; ++i) hashh[i] = hashh[i - 1] * 37 + a[i];
  for (int len = 2; len < n; ++len) {
    if (n % len) continue;
    if (check(len, n)) {
      printf("2\n%d", calc(len) - delta(cnt, len));
      return 0;
    }
  }
  printf("1\n1");
  return 0;
}
