#include using namespace std; typedef int ll; #define REP(i,n) FOR(i,0,n) #define FOR(i,a,b) for(ll i=a;i vi; typedef vector> vvi; const ll INF = (1ll << 30); typedef pair pii; struct Edge{ ll s,t,c; }; typedef vector> Graph; typedef vector vpii; int main() { string S; cin>>S; ll N=S.length(); ll ans=0; REP(i,N) { ll cnt=0; for(ll j=1;i+j=0;j++) { if(S[i+j]==S[i-j]) cnt++; } ans=max(ans,cnt); } cout<<1+ans*2<