/* -------------------------------- Template -------------------------------- */

#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstring>
#include <deque>
#include <functional>
#include <iomanip>
#include <locale>
#include <iostream>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>

#define REP(i,n) for(int i=0;i<(int)(n);i++)
#define ALL(x) (x).begin(),(x).end()

using ll = long long;
using ld = long double;

template <typename T> T &chmin(T &a, const T &b) { return a = std::min(a, b); }
template <typename T> T &chmax(T &a, const T &b) { return a = std::max(a, b); }

template<typename T> constexpr T inf = [](){ assert(false); };
template<> constexpr int inf<int> = 1e9;
// template<> constexpr ll inf<ll> = 1e18;
// template<> constexpr ld inf<ld> = 1e30;

struct yes_no : std::numpunct<char> {
  string_type do_truename()  const { return "Yes"; }
  string_type do_falsename() const { return "No"; }
};

class range {
  class Index {
    int x;
  public:
    Index(int x) : x(x) {}
    int operator*() const { return x; }
    bool operator!=(Index &r) { return x < r.x; }
    void operator++() { ++x; }
  };
  Index i, n;
public:
  range(int n) : i(0), n(n) {}
  range(int i, int n) : i(i), n(n) {}
  Index &begin() { return i; }
  Index &end() { return n; }
};

template <class A, class B> class zip_t {
  using res_t = std::pair<typename A::iterator, typename B::iterator>;
  class iter : public std::iterator<std::input_iterator_tag,
                                    res_t,          // value_type
                                    std::ptrdiff_t, // difference_type
                                    res_t*,         // pointer
                                    res_t> {        // reference
    typename A::iterator a; typename B::iterator b;
  public:
    iter(typename A::iterator a, typename B::iterator b) : a(a), b(b) {}
    res_t operator*() { return res_t(*a, *b); }
    bool operator==(iter x) { return a == x.a; }
    bool operator!=(iter x) { return !(*this == x); }
    iter& operator++() { ++a; ++b; return *this; }
    iter operator++(int) { iter ret = *this; ++(*this); return ret; }
  };
  iter i, n;
public:
  zip_t(A &a, B &b) : i(a.begin(), b.begin()), n(a.end(), b.end()) {}
  iter &begin() { return i; }
  iter &end() { return n; }
};

template<typename A, typename B>
zip_t<A, B> zip(A &a, B &b) { return zip_t<A, B>(a, b); }

std::pair<int,int> solve();

int main() {
  std::locale loc(std::locale(), new yes_no);
  std::cout << std::boolalpha << std::setprecision(12) << std::fixed;
  std::cout.imbue(loc);
  auto res = solve();
  std::cout << res.first << std::endl << res.second << std::endl;
  return 0;
}

using namespace std;

/* -------------------------------- Library -------------------------------- */

template <typename T, const T& merge(const T&, const T&)>
class SegmentTree {
  const int n;
  const T id;
  vector<T> data;
  T sub(int l, int r, int node, int lb, int ub) const {
    if (ub <= l || r <= lb) return id;
    if (l <= lb && ub <= r) return data[node];
    T vl = sub(l, r, node * 2 + 0, lb, (lb + ub) / 2);
    T vr = sub(l, r, node * 2 + 1, (lb + ub) / 2, ub);
    return merge(vl, vr);
  }
  int size(int n) const {
    return n == 1 ? n : size((n + 1) / 2) * 2;
  }
public:
  SegmentTree(int m, T id) : n(size(m)), id(id), data(n * 2, id) {}
  void update(int p, T val) {
    assert (0 <= p && p < n);
    p += n;
    data[p] = val;
    while (p /= 2) {
      int l = p * 2, r = p * 2 + 1;
      data[p] = merge(data[l], data[r]);
    }
  }
  T find(int l, int r) const {
    return sub(l, r, 1, 0, n);
  }
};

struct SuffixArray {
  struct SAComp {
    const int h;
    const vector<int> &g;
    SAComp(int h, vector<int> &g) : h(h), g(g) {;}
    bool operator() (int a, int b) {
      return a != b && (g[a] != g[b] ? g[a] < g[b] : g[a + h] < g[b + h]);
    }
  };

  int n;
  char *str;
  vector<int> sa, lcp;

  SuffixArray(const string &t) : n(t.size()), sa(n+1), lcp(n+1) {
    str = new char[n+1];
    strcpy(str, t.c_str());

    // build SA
    vector<int> g(n+1, 0), b(n+1, 0);
    for (int i = 0; i <= n; ++i) { sa[i] = i; g[i] = str[i]; }
    sort(begin(sa), end(sa), SAComp(0, g));
    for (int h = 1; b[n] != n; h *= 2) {
      SAComp comp(h, g);
      sort(sa.begin(), sa.end(), comp);
      for (int i = 0; i < n; ++i)
        b[i+1] = b[i] + comp(sa[i], sa[i+1]);
      for (int i = 0; i <= n; ++i)
        g[sa[i]] = b[i];
    }

    // build LCP
    int h = 0;
    for (int i = 0; i <= n; ++i) b[sa[i]] = i;
    for (int i = 0; i <= n; ++i) {
      if (b[i]) {
        for (int j = sa[b[i]-1]; j+h<n && i+h<n && str[j+h] == str[i+h]; ++h);
        lcp[b[i]] = h;
      }
      else {
        lcp[b[i]] = -1;
      }
      if (h > 0) --h;
    }
  }
  ~SuffixArray() { delete []str; }

  int find(string t) {
    int m = t.size();
    char p[m+1];
    strcpy(p, t.c_str());
    int left = -1, right = n + 1;
    while (left + 1 < right) {
      int mid = (left + right) / 2;
      if (strncmp(str + sa[mid], p, m) < 0) left = mid;
      else right = mid;
    }
    return strncmp(str + sa[right], p, m) == 0 ? sa[right] : -1;
  }
};

class LCP {
  int n;
  vector<int> mapsto;
  SegmentTree<int,min> seg;
public:
  LCP(const string &str) : n(str.size()), mapsto(n), seg(n, inf<int>) {
    SuffixArray sa(str);
    for (int i = 0; i < n; ++i) mapsto[sa.sa[i+1]] = i;
    for (int i = 0; i < n-1; ++i) seg.update(i, sa.lcp[i+2]);
  }
  int query(int i, int j) {
    if (i == j) return n - i;
    i = mapsto[i]; j = mapsto[j];
    return seg.find(min(i, j), max(i, j));
  }
};

/* ---------------------------------- Main ---------------------------------- */

pair<int,int> solve() {
  string s;
  cin >> s;
  const int n = s.size();
  string t = s;
  reverse(ALL(t));

  vector<int> bad1(n + 1), bad2(n + 1);
  LCP lcp1(s), lcp2(t);
  for (int cycle = 1; cycle < n; ++cycle) {
    const int len = lcp1.query(0, cycle) + cycle;
    for (int j = cycle * 2; j <= len; j += cycle) bad1[j] = 1;
  }
  for (int cycle = 1; cycle < n; ++cycle) {
    const int len = lcp2.query(0, cycle) + cycle;
    for (int j = cycle * 2; j <= len; j += cycle) bad2[j] = 1;
  }
  if (!bad1[n]) return make_pair(1, 1);
  if (lcp1.query(0, 1) == n - 1) return make_pair(n, 1);
  int res = 0;
  for (int i = 1; i < n; ++i) {
    const int j = n - i;
    if (!bad1[i] && !bad2[j]) ++res;
  }
  return make_pair(2, res);
}


Measured memory_bytes: 25604