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

const int DIM = 5e5 + 5;

bool lef[DIM], rig[DIM];
char str[DIM]; int prf[DIM];

void solve( char str[DIM], bool arr[DIM], int n ) {
    
    for( int i = 2, l = 0; i <= n; i ++ ) {
        while( l != 0 && str[i] != str[l + 1] )
            l = prf[l];
        
        if( str[i] == str[l + 1] )
            l ++;
        
        prf[i] = l;
        arr[i] = ( l != 0 && i % (i - l) == 0 );
    }
    
    return;
}

int main( void ) {
    
    cin >> ( str + 1 );
    int n = (int) strlen( str + 1 );
    
    solve( str, lef, n );
    reverse( str + 1, str + n + 1 );
    
    solve( str, rig, n );
    reverse( rig + 1, rig + n + 1 );
    
    if( lef[n] == false )
        cout << "1\n1\n";
    else
    if( count( str + 1, str + n + 1, str[1] ) == n )
        cout << n << "\n1\n";
    else {
        int ans = 0;
        for( int i = 1; i < n; i ++ )
            ans += ( lef[i] == false && rig[i + 1] == false );
    
        cout << "2\n" << ans << "\n";
    }
    
    return 0;
}