#include <bits/stdc++.h>
using namespace std;
using uint = unsigned int;
using lint = long long int;
using ulint = unsigned long long int;
template<class T = int> using V = vector<T>;
template<class T = int> using VV = V< V<T> >;
template<class T, class U> void assign(V<T>& v, int n, const U& a) { v.assign(n, a); }
template<class T, class... Args> void assign(V<T>& v, int n, const Args&... args) { v.resize(n); for (auto&& e : v) assign(e, args...); }


template<class Int> constexpr bool is_prime(Int n) {
  if (n < 2 or n > 2 and ~n & 1) return false;
  for (Int i = 3; i * i <= n; i += 2) if (n % i == 0) return false;
  return true;
}
template<uint P> struct ModInt {
  static_assert(is_prime(P), "template argument must be a prime number");
  using M = ModInt;
  uint v;
  ModInt() : v(0) {}
  template<class Int> ModInt(Int x) : v(x >= 0 ? x % P : -x % P ? P - -x % P : 0) {}
  constexpr ModInt(uint v, int _) : v(v) {} // 直接値を初期化
  static constexpr uint p() { return P; }
  M operator++(int) { M t = *this; if (++v == P) v = 0; return t; }
  M operator--(int) { M t = *this; v = (v ? v : P) - 1; return t; }
  M& operator++() { if (++v == P) v = 0; return *this; }
  M& operator--() { v = (v ? v : P) - 1; return *this; }
  M operator+() const { return *this; }
  M operator-() const { return {v ? P - v : 0, 0}; }
  explicit operator bool() const noexcept { return v; }
  bool operator!() const noexcept { return !static_cast<bool>(*this); }
  M operator*(M rhs) const { return M(*this) *= rhs; }
  M operator/(M rhs) const { return M(*this) /= rhs; }
  M operator+(M rhs) const { return M(*this) += rhs; }
  M operator-(M rhs) const { return M(*this) -= rhs; }
  bool operator==(M rhs) { return v == rhs.v; }
  bool operator!=(M rhs) { return !(*this == rhs); }
  M& operator*=(M rhs) { v = (ulint) v * rhs.v % P; return *this; }
  M& operator/=(M rhs) { return *this *= rhs.inv(); }
  M& operator+=(M rhs) { v = rhs.v < P - v ? v + rhs.v : v - (P - rhs.v); return *this; }
  M& operator-=(M rhs) { v = rhs.v <= v ? v - rhs.v : v + (P - rhs.v); return *this; }
  M inv() const {
    assert(v);
    #ifdef __linux__ // ACとCFで動作を変えるための仮の対処
      return pow(P - 2);
    #else
      int a = v, b = P, x = 1, u = 0;
      while (b) {
        int q = a / b;
        swap(a -= q * b, b);
        swap(x -= q * u, u);
      }
      return x;
    #endif
  }
  template<class Int> M pow(Int n) const {
    n = n >= 0 ? n % (P - 1) : P - 1 - -n % (P - 1);
    M res = 1;
    for (M a = *this; n > 0; a *= a, n >>= 1) if (n & 1) res *= a;
    return res;
  }
  template<class Int> friend M operator*(Int lhs, M rhs) { return M(lhs) *= rhs; }
  template<class Int> friend M operator/(Int lhs, M rhs) { return M(lhs) /= rhs; }
  template<class Int> friend M operator+(Int lhs, M rhs) { return M(lhs) += rhs; }
  template<class Int> friend M operator-(Int lhs, M rhs) { return M(lhs) -= rhs; }
  friend ostream& operator<<(ostream& os, M rhs) { return os << rhs.v; }
  friend istream& operator>>(istream& is, M& rhs) { lint x; is >> x; rhs = x; return is; }
  template<class Int> friend bool operator==(Int lhs, M rhs) { return M(lhs) == rhs; }
  template<class Int> friend bool operator!=(Int lhs, M rhs) { return !(lhs == rhs); }
};

template<class Int> Int rng(Int a, Int b) {
  static mt19937 mt(chrono::steady_clock().now().time_since_epoch().count());
  assert(a < b);
  return uniform_int_distribution<Int>(a, b - 1)(mt);
}

struct RollingHash {
  using Mint0 = ModInt<1'000'000'007>;
  using Mint1 = ModInt<1'000'000'009>;
  const int n;

  template<class Itr> RollingHash(Itr first, Itr last) :
    n(distance(first, last)), h0(n + 1), powb0(n + 1), h1(n + 1), powb1(n + 1) {
    powb0[0].v = powb1[0].v = 1;
    for (int i = 0; i < n; ++i, ++first) {
      h0[i + 1] = h0[i] * b0 + Mint0(*first);
      h1[i + 1] = h1[i] * b1 + Mint1(*first);
      powb0[i + 1] = powb0[i] * b0;
      powb1[i + 1] = powb1[i] * b1;
    }
  }

  pair<int, int> get(int l, int r) {
    assert(0 <= l and l < r and r <= n);
    return {(h0[r] - h0[l] * powb0[r - l]).v, (h1[r] - h1[l] * powb1[r - l]).v};
  }

private:
  static Mint0 b0;
  static Mint1 b1;
  V<Mint0> h0, powb0;
  V<Mint1> h1, powb1;
};
RollingHash::Mint0 RollingHash::b0 = rng<int>(0, RollingHash::Mint0::p());
RollingHash::Mint1 RollingHash::b1 = rng<int>(0, RollingHash::Mint1::p());

V<> factor;
void init(int n) {
  assert(n > 0);
  factor.resize(n + 1);
  factor[0] = factor[1] = -1;
  for (int p = 2; p * p <= n; ++p) if (factor[p] == 0) {
    for (int i = p * p; i <= n; i += p) if (factor[i] == 0) {
      factor[i] = p;
    }
  }
}

map<int, int> factorize(int n) {
  assert(0 < n and n < factor.size());
  map<int, int> res;
  while (factor[n] > 0) {
    ++res[factor[n]];
    n /= factor[n];
  }
  if (factor[n] == 0) ++res[n];
  return res;
}

int main() {
  cin.tie(nullptr); ios_base::sync_with_stdio(false);
  string s; cin >> s;
  int n = s.size();

  if (count(begin(s), end(s), s[0]) == n) return cout << n << "\n1\n", 0;

  init(n);
  RollingHash rh(begin(s), end(s));
  auto chk = [&](int l, int r) -> bool {
    auto mp = factorize(r - l);
    for (const auto& e : mp) {
      int d = (r - l) / e.first;
      if (rh.get(l, r - d) == rh.get(l + d, r)) return false;
    }
    return true;
  };

  if (chk(0, n)) return cout << "1\n1\n", 0;

  int res = 0;
  for (int i = 1; i < n; ++i) {
    res += chk(0, i) and chk(i, n);
  }
  cout << "2\n" << res << '\n';
}

Measured memory_bytes: 10652