#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long ll; #define sz size() #define pb push_back #define mp make_pair #define fi first #define se second #define all(c) (c).begin(), (c).end() #define rep(i,a,b) for(ll i=(a);i<(b);++i) #define per(i,a,b) for(ll i=(b-1);i>=(a);--i) #define clr(a, b) memset((a), (b) ,sizeof(a)) #define ctos(c) string(1,c) #define print(x) cout<<#x<<" = "<>s; ll length = s.sz; string s1; rep(i,0,2000){ s1 += "*"; } s = s1 + s + s1; rep(i,1500,s.sz-1500){ ll c = 0; rep(j,0,1200){ if(s[i+j]!=s[i-j]){ if(s[i+j]=='*'||s[i-j]=='*'){ c++; } else{ c+=2; } } } mx = max(mx,length-c); } rep(i,1500,s.sz-1500){ ll c = 0; rep(j,0,1200){ if(s[i+1+j]!=s[i-j]){ if(s[i+1+j]=='*'||s[i-j]=='*'){ c++; } else{ c+=2; } } } mx = max(mx,length-c); } cout << mx << endl; return 0; }