#include <bits/stdc++.h>
#define err(args...) {}
#ifdef DEBUG
#include "_debug.cpp"
#endif
using namespace std;
using ll = long long;
template <typename T> using lim = numeric_limits<T>;
template <typename T> istream& operator>>(istream& is, vector<T>& a) { for(T& x : a) { is >> x; } return is; }
seed_seq seq {
    (uint64_t) chrono::duration_cast<chrono::nanoseconds>(chrono::high_resolution_clock::now().time_since_epoch()).count(),
    (uint64_t) __builtin_ia32_rdtsc(),
    (uint64_t) (uintptr_t) make_unique<char>().get()
};
mt19937 rng(seq);
struct hash_struct {
    struct hash_parameters {
        const uint64_t M, X;
        const function<uint64_t(uint64_t, uint64_t)> add, sub, mul;
        vector<uint64_t> mpow;
        void resize(int n) {
            if(mpow.size() < n) {
                mpow.resize(n);
                for(int i = 0; i < n; i++) {
                    mpow[i] = i ? mul(mpow[i - 1], X) : 1;
                }
            }
        }
    };
    hash_parameters& h;
    vector<uint64_t> rolling;
    hash_struct(hash_parameters& h, const string& s)
    : h(h), rolling(s.size() + 1) {
        h.resize(s.size() + 1);
        for(int i = int(s.size()) - 1; i >= 0; i--) {
            rolling[i] = h.add(h.mul(rolling[i + 1], h.X), s[i]);
        }
    }
    uint64_t query(int L, int R) {
        assert(L <= R);
        return h.sub(rolling[L], h.mul(rolling[R], h.mpow[R - L]));
    }
};
hash_struct hash1(const string& s) {
    constexpr uint64_t M = (1ull << 61) - 1;
    static uint64_t X = uniform_int_distribution<uint64_t>(256, M - 1)(rng);
    static constexpr auto add = [](uint64_t a, uint64_t b) { return a + b >= M ? a + b - M : a + b; };
    static constexpr auto sub = [](uint64_t a, uint64_t b) { return add(a, M - b); };
    static constexpr auto mul = [](uint64_t a, uint64_t b) {
        uint64_t l1 = (uint32_t)a, h1 = a >> 32, l2 = (uint32_t)b, h2 = b >> 32;
        uint64_t l = l1 * l2, m = l1 * h2 + l2 * h1, h = h1 * h2;
        uint64_t ret = (l & M) + (l >> 61) + (h << 3) + (m >> 29) + (m << 35 >> 3) + 1;
        ret = (ret & M) + (ret >> 61);
        ret = (ret & M) + (ret >> 61);
        return ret - 1;
    };
    static hash_struct::hash_parameters h = {M, X, add, sub, mul};
    return hash_struct(h, s);
}
hash_struct hash2(const string& s) {
    constexpr uint64_t M = (1ull << 31) - 1;
    static uint64_t X = uniform_int_distribution<uint64_t>(256, M - 1)(rng);
    static constexpr auto add = [](uint64_t a, uint64_t b) { return a + b >= M ? a + b - M : a + b; };
    static constexpr auto sub = [](uint64_t a, uint64_t b) { return add(a, M - b); };
    static constexpr auto mul = [](uint64_t a, uint64_t b) {
        uint64_t ret = a * b + 1;
        ret = (ret & M) + (ret >> 31);
        ret = (ret & M) + (ret >> 31);
        return ret - 1;
    };
    static hash_struct::hash_parameters h = {M, X, add, sub, mul};
    return hash_struct(h, s);
}
vector<int> get_periods(string& s) {
    auto h1 = hash1(s), h2 = hash2(s);
    vector<int> periods(s.size() + 1);
    iota(periods.begin(), periods.end(), 0);
    for(int k = s.size() - 1; k >= 1; k--) {
        bool can = true;
        for(int i = 0; i + k <= s.size() and can; i += k) {
            can &= h1.query(0, k) == h1.query(i, i + k)
                and h2.query(0, k) == h2.query(i, i + k);
            if(can) {
                periods[i + k] = k;
            }
        }
    }
    return periods;
}
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    string s;
    cin >> s;
    vector<int> period_left = get_periods(s);
    reverse(s.begin(), s.end());
    vector<int> period_right = get_periods(s);
    if(period_left[s.size()] == s.size()) {
        cout << 1 << endl;
        cout << 1 << endl;
    } else if(period_left[s.size()] == 1) {
        cout << s.size() << endl;
        cout << 1 << endl;
    } else {
        cout << 2 << endl;
        int ans = 0;
        for(int i = 1; i < s.size(); i++) {
            ans += period_left[i] == i and period_right[s.size() - i] == s.size() - i;
        }
        cout << ans << endl;
    }
    return 0;
}


Measured memory_bytes: 20260