import std.stdio, std.array, std.string, std.conv, std.algorithm;
import std.typecons, std.range, std.random, std.math, std.container;
import std.numeric, std.bigint, core.bitop;

int[] z_algorithm(string s) {
    int n = s.length.to!int;
    auto ans = new int[](n);
    int L, R;
    
    foreach (i; 1..n) {
        if (i > R || ans[i-L] >= R-i+1) {
            L = i;
            R = (i > R) ? i - 1 : R;
            while (R+1 < n && s[R-L+1] == s[R+1]) R++;
            ans[i] = R - L + 1;
        }
        else {
            ans[i] = ans[i-L];
        }
    }
 
    return ans;
}

void main() {
    auto S = readln.chomp;
    auto N = S.length.to!int;

    if (S.map!(s => s == S[0]).all) {
        writeln(N);
        writeln(1);
        return;
    }

    
    auto z = z_algorithm(S);
    int rep = -1;

    foreach (i; 2..N) {
        if (N % i == 0 && z[i] == N-i) {
            rep = i;
            break;
        }
    }

    
    if (rep == -1) {
        writeln(1);
        writeln(1);
    } else {
        writeln(2);
        int ans = N / rep * (rep - 1);
        if (N / rep == 2) ans += 1;

        auto T = S[0..rep];
        auto zp = z_algorithm(T);
        string U;
        foreach (i; 0..rep) U ~= T[rep-i-1];
        auto zs = z_algorithm(U);

        foreach (i; 1..rep/2+1) {
            if (zp[i] >= i) ans -= 1;
            if (zs[i] >= i) ans -= 1;
        }
        ans.writeln;
    }

    
}
