char s[9];i,j,k;main(f){for(i=strlen(gets(s))-1;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);}