#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<cstdlib>
using namespace std;
#ifdef __int64
typedef __int64 LL;
#else
typedef long long LL;
#endif
typedef double db;
const int N = 200015;
const int INF = ~0u>>2;
char s[N],str[2*N];
int len[2*N];
inline int manager(){
    int i;
    str[0] = '$';
    for(i = 0;; i ++){
        str[2*i+1] = '#',str[2*i+2] = s[i];
        if(!s[i]) break;
    }
    int id,mx = 0;
    for(i = 1;str[i]; i ++){
        if(mx>i) len[i] = min(len[2*id-i],mx-i);
        else len[i] = 1;
        while(str[i-len[i]]==str[i+len[i]]) len[i] ++;
        if(i+len[i] > mx){
            mx = i + len[i];
            id = i;
        }
    }
    mx = 0;
    for(int i = 1;str[i];i++) if(mx < len[i]) mx = len[i];
    return mx - 1;
}
int main()
{
    //freopen("input.in","r",stdin);
    //freopen("output.out","w",stdout);
//    while(~scanf("%s",s))
//    {
//        printf("%d\n",manager());
//    }
    LL x = 1;
return 0;
}