#include <stdio.h>
char str[50010];
unsigned long long x, y, P[50010], B = 1947698881ULL;
int F(int i, int j){
if(i >= j) return (i == j);
x = y = 0;
int r = 1, l = 0;
while (i < j){
x = x * B + str[i];
y = P[l] * str[j] + y;
if (x == y){
r = 2 + F(i + 1, j - 1);
break;
}
i++, l++, j--;
}
return r;
}
int main(){
int T = 0, t, i;
P[0] = 1ULL;
for(i = 1; i < 50010; i++) P[i] = (P[i - 1] * B);
while (t--){
}
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CgpjaGFyIHN0cls1MDAxMF07Cgp1bnNpZ25lZCBsb25nIGxvbmcgeCwgeSwgUFs1MDAxMF0sIEIgPSAxOTQ3Njk4ODgxVUxMOwoKaW50IEYoaW50IGksIGludCBqKXsKICAgIGlmKGkgPj0gaikgcmV0dXJuIChpID09IGopOwoKICAgIHggPSB5ID0gMDsKICAgIGludCByID0gMSwgbCA9IDA7CiAgICB3aGlsZSAoaSA8IGopewogICAgICAgIHggPSB4ICogQiArIHN0cltpXTsKICAgICAgICB5ID0gUFtsXSAqIHN0cltqXSArIHk7CiAgICAgICAgaWYgKHggPT0geSl7CiAgICAgICAgICAgIHIgPSAyICsgRihpICsgMSwgaiAtIDEpOwogICAgICAgICAgICBicmVhazsKICAgICAgICB9CiAgICAgICAgaSsrLCBsKyssIGotLTsKICAgIH0KICAgIHJldHVybiByOwp9CmludCBtYWluKCl7CiAgICBpbnQgVCA9IDAsIHQsIGk7CiAgICBQWzBdID0gMVVMTDsKICAgIGZvcihpID0gMTsgaSA8IDUwMDEwOyBpKyspIFBbaV0gPSAoUFtpIC0gMV0gKiBCKTsKCiAgICBzY2FuZigiJWQiLCAmdCk7CiAgICB3aGlsZSAodC0tKXsKICAgICAgICBzY2FuZigiJXMiLCBzdHIpOwogICAgICAgIHByaW50ZigiQ2FzZSAjJWQ6ICVkXG4iLCArK1QsIEYoMCwgc3RybGVuKHN0cikgLSAxKSk7CiAgICB9CiAgICByZXR1cm4gMDsKfQo=