#include <bits/stdc++.h>
using namespace std;
template <class T>
constexpr T lcm(T m, T n) {
  return m / __gcd(m, n) * n;
}
template <typename I>
void join(ostream &ost, I s, I t, string d = " ") {
  for (auto i = s; i != t; ++i) {
    if (i != s) ost << d;
    ost << *i;
  }
  ost << endl;
}
template <typename T>
istream &operator>>(istream &is, vector<T> &v) {
  for (auto &a : v) is >> a;
  return is;
}
template <typename T, typename U>
istream &operator>>(istream &is, pair<T, U> &p) {
  is >> p.first >> p.second;
  return is;
}
template <typename T, typename U>
bool chmin(T &a, const U &b) {
  return (a > b ? a = b, true : false);
}
template <typename T, typename U>
bool chmax(T &a, const U &b) {
  return (a < b ? a = b, true : false);
}
template <typename T, size_t N, typename U>
void fill_array(T (&a)[N], const U &v) {
  fill((U *)a, (U *)(a + N), v);
}
template <typename T>
class RollingHash {
 private:
  T str;
  long long int base, mod;
  int sl;
  vector<long long int> shash, pow;

 public:
  RollingHash(const T &str, long long int base, long long int mod)
      : str(str),
        base(base),
        mod(mod),
        sl(str.size()),
        shash(sl + 1),
        pow(sl + 1) {
    pow[0] = 1;
    shash[0] = 0;
    for (long long int i = (1); i <= (sl); ++i) {
      shash[i] = (shash[i - 1] * base + str[i - 1]) % mod;
      pow[i] = pow[i - 1] * base % mod;
    }
  }
  long long int hash(int i, int j) {
    return (shash[j] - shash[i] * pow[j - i] + mod * mod) % mod;
  }
  long long int hash(const T &p) {
    long long int phash = 0;
    for (long long int i = (0); i < ((int)p.size()); ++i)
      phash = (phash * base + p[i]) % mod;
    return phash;
  }
  vector<int> find(const T &p) {
    vector<int> ret;
    int pl = p.size();
    long long int phash = hash(p);
    for (long long int i = (0); i <= (sl - pl); ++i)
      if (hash(i, i + pl) == phash) ret.push_back(i);
    return ret;
  }
};
const long long int mod = 1e9 + 7;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  string s;
  while (cin >> s) {
    int n = s.size();
    RollingHash<string> rh(s, 31, mod);
    int ans = 0;
    long long int ans_count = 0;
    int p = n;
    vector<bool> is_good(n + 1, true);
    for (long long int i = (1); i <= (n); ++i) {
      for (int k = 2 * i; k <= n; k += i) {
        if (rh.hash(0, i) == rh.hash(k - i, k)) {
          is_good[k] = false;
          if (k == n) {
            chmin(p, i);
          }
        } else {
          break;
        }
      }
    }
    ((void)0);
    ((void)0);
    if (all_of((s).begin(), (s).end(), [&](char c) { return c == s[0]; })) {
      ans = n;
      ans_count = 1;
    } else if (is_good[n]) {
      ans = 1;
      ans_count = 1;
    } else {
      ans = 2;
      ans_count = (p - 1) * (n / p);
      if (n / p == 2) ans_count += 1;
    }
    cout << ans << endl;
    cout << ans_count << endl;
  }
  return 0;
}
