#include <iostream>
#include <map>
#include <set>
#include <cmath>
#include <algorithm>
#include <vector>
#include <string>
#include <fstream>
#include <bitset>
#include <queue>
#include <stack>
#include <deque>
#include <complex>
#include <iomanip>
#include <stdio.h>
#include <string.h>
#include <random>
#include <functional>

using std::cin;
using std::cout;
using std::cerr;
using std::endl;

using std::map;
using std::set;
using std::bitset;
using std::vector;
using std::string;
using std::multimap;
using std::multiset;
using std::deque;
using std::queue;
using std::stack;
using std::pair;
using std::iterator;

using std::sort;
using std::stable_sort;
using std::reverse;
using std::max_element;
using std::min_element;
using std::unique;
using std::ios_base;
using std::swap;
using std::fill;

using std::setprecision;
using std::fixed;

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<long long> vl;
typedef string S;

ll min(ll a, ll b) {return a < b ? a : b;}
ll min(int a, ll b) {return a < b ? a : b;}
ll min(ll a, int b) {return a < b ? a : b;}
ll min(int a, int b) {return a < b ? a : b;}

ll max(ll a, ll b) {return a > b ? a : b;}
ll max(int a, ll b) {return a > b ? a : b;}
ll max(ll a, int b) {return a > b ? a : b;}
ll max(int a, int b) {return a > b ? a : b;}

namespace MySpace{

};

#define F(i, n) for (int (i) = 0; (i) != (n); (i)++)
#define fi first
#define se second
#define re return
#define all(x) (x).begin(), (x).end()
#define int long long

const ll MOD = 1e9 + 7;
const ll M = 1e6 + 3;
const int N = 500010;

string s;

int pref_ok[N];
int suff_ok[N];
int erato[N];
int h[N];
int flen[N];

long long g(int l, int r)
{
    int len = r - l + 1;
    int prf = l ? h[l - 1] : 0;
    return (h[r] - prf * flen[len] + MOD * MOD) % MOD;
}

signed main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    cin >> s;
    int c = 0;
    for (int i = 0; i + 1 < s.size(); i++) if (s[i] != s[i + 1]) c = 1;
    if (c == 0) cout << s.size() << " " << 1, exit(0);
    flen[0] = 1, flen[1] = M;
    for (int i = 2; i < N; i++)
    {
        flen[i] = flen[i - 1] * M % MOD;
        if (erato[i] == 0)
        {
            for (int j = 1; j * i < N; j++)
            {
                erato[i * j] = i;
            }
        }
    }
    h[0] = s[0];
    pref_ok[0] = 1;
    for (int i = 1; i < s.size(); i++)
    {
        h[i] = (h[i - 1] * M + s[i]) % MOD;
        int cl = i + 1, pe = i + 1;
        while (cl > 1)
        {
            int divide = erato[cl];
            cl /= divide;
            if (g(0, i - pe / divide) == g(pe / divide, i))
                pe /= divide;
        }
        if (pe == i + 1)
            pref_ok[i] = 1;
    }
    if (pref_ok[s.size() - 1]) cout << 1 << " " << 1, exit(0);
    h[0] = s[s.size() - 1];
    suff_ok[s.size() - 1] = 1;
    for (int i = 1; i < s.size(); i++)
    {
        h[i] = (h[i - 1] * M + s[s.size() - 1 - i]) % MOD;
        int cl = i + 1, pe = i + 1;
        while (cl > 1)
        {
            int divide = erato[cl];
            cl /= divide;
            if (g(0, i - pe / divide) == g(pe / divide, i))
                pe /= divide;
        }
        if (pe == i + 1)
            suff_ok[s.size() - 1 - i] = 1;
    }
    int res = 0;
    for (int i = 0; i < s.size(); i++) if (pref_ok[i] && suff_ok[i + 1]) res++;
    cout << 2 << " " << res;
}


Measured memory_bytes: 20380