#include using namespace std; typedef long long ll; #define REP(i,n) for(int i=0,_n=(int)(n);i<_n;++i) #define ALL(v) (v).begin(),(v).end() templateostream& operator<<(ostream& os,const pair&a){return os<<"("<void pv(T a,T b){for(T i=a;i!=b;++i)cout<<(*i)<<" ";cout<bool chmin(T&a,const T&b){return a>b?(a=b,1):0;} templatebool chmax(T&a,const T&b){return a> s; int N = (int)s.size(); int ans = 0; REP(c, N) { int here = 1; for (int i = 1; i <= N; i++) { char a = get(s, c + i); char b = get(s, c - i); if (a != ' ' && b != ' ' && a == b) { here += 2; } } chmax(ans, here); } REP(c, N) { int here = 0; for (int i = 1; i <= N; i++) { char a = get(s, c + i - 1); char b = get(s, c - i); if (a != ' ' && b != ' ' && a == b) { here += 2; } } chmax(ans, here); } cout << ans << endl; return 0; } int main() { for (;!cin.eof();cin>>ws) main2(); return 0; }