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