S=input() for i in range(len(S)-3): if S[i]==S[i+2]: j=0 c=3 a=3 while i-j>=0 and i+ja: a=c print(a)