char s[99];i,j,k;main(f){for(i=strlen(gets(s))-2;j+k>i+j-k|(f=s[j+k]-s[i+j-k++])?k=0,j++,f&&s[i+j]||(j=0,f&&--i):1;);i=!printf("%d",i+1);}