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