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