#include <bits/stdc++.h>
using namespace std;

char w[500005];

const long long MOD = 1e9+7;

int shortestRepeatingUnit = -1;

bool isGood(int s, int e){
    int M = (e-s+1);
    //printf("M=%d\n", M);
    for(int k = 1; k < M; k ++){
        bool valid = true;
        if(M%k == 0){
            // repeating string length
            for(int i = 0; i < k; i ++){
                // index of repeating string
                for(int j = s+i; j <= e; j += k){
                    if(w[j] != w[s+i]){
                        valid = false;
                        break;
                    }
                }
                if(!valid){
                    break;
                }
            }
            if(valid){
                // There is a repeating string
                //printf("Repeating length of %d exists\n", k);
                shortestRepeatingUnit = k;
                return false;
            }
        }
    }
    return true;
}

bool repeat1[500005];
bool repeatPrefix[500005]; // first n characters, where n is index of array
bool repeatSuffix[500005]; // last n characters, where n is suffix of array

int N;

void checkPrefix(int k){
    // k is the repeat string length
    bool possible = true;
    int p = 0; // number of characters processed
    for(int i = 1; (i+1)*k <= N; i ++){
        p += k;
        for(int j = 0; j < k; j ++){
            if(w[p+j] != w[j]){
                return;
            }
        }
        // check passed
        repeat1[p+k] = true; // the string consisting of the first p+k characters is bad
    }
}

int main(){
    scanf(" %s", w);

    N = strlen(w);
    //printf("N=%d\n", N);

    // Editorial says the length of best representation is either 1, 2 or N

    // If and only if all characters are the same, the first answer is N
    bool answerIsN = true;
    for(int i = 0; i < N; i ++){
        if(w[i] != w[0]){
            answerIsN = false;
            break;
        }
    }

    // If first answer is N, there is only 1 partition
    if(answerIsN){
        printf("%d\n1\n", N);
        return 0;
    }

    // To check if answer is 1, the whole string must be good
    bool stringIsGood = isGood(0, N-1);

    // If first answer is N, there is only 1 partition
    if(stringIsGood){
        printf("1\n1\n");
        return 0;
    }

    // Otherwise, the string is bad, with the smallest repeating length at least 2.
    // If we take the first character, and the remaining string (without the first character),
    // this forms a good representation since the existing concatenation will be destroyed.
    printf("2\n");

    // There are at most N ways to partition, hence the mod step is essentially useless.
    // One can check every single possible prefix and suffix and check whether the substring is good.
    // This yields a slightly worse than quadratic solution.

    /*int ans = 0;
    for(int i = 1; i < N; i ++){
        ans += (isGood(0, i-1) && isGood(i, N-1));
    }

    printf("%d\n", ans);*/

    memset(repeat1, false, sizeof(repeat1));
    for(int k = 1; k <= shortestRepeatingUnit; k ++){
        if(!repeat1[k]){
            //printf("check prefix %d\n", k);
            checkPrefix(k);
        }
    }

    for(int i = 1; i <= N; i ++){
        repeatPrefix[i] = repeat1[i];
        //printf("repeatPrefix[%d]: %d\n", i, repeat1[i]);
    }

    reverse(w, w+N);
    memset(repeat1, false, sizeof(repeat1));
    for(int k = 1; k <= shortestRepeatingUnit; k ++){
        if(!repeat1[k]){
            //printf("check suffix %d\n", k);
            checkPrefix(k);
        }
    }

    //printf("%s\n", w);
    for(int i = 1; i <= N; i ++){
        repeatSuffix[i] = repeat1[i];
        //printf("repeatSuffix[%d]: %d\n", i, repeat1[i]);
    }

    int ans2 = 0;
    for(int i = 1; i < N; i ++){
        ans2 += !repeatPrefix[i] && !repeatSuffix[N-i];
    }

    printf("%d\n", ans2);
    return 0;
}


Measured memory_bytes: 2176