t=gets.chars*" " t.size.times{|l|c=1&~r=l t[l-=1]==t[r]&&c+=~l%2*2while t[r+=1] c>$.&&$.=c} p$.