#include <bits/stdc++.h>

using namespace std;

int main(){
    string s;
    cin >> s;
    int n = s.length();
    int rez = 1; int rez1 = 1;
    int i = 0; int mi = 0; int ma = n-1;
    vector<int> v;
    vector<int> v1;
    bool g=n%2;
    for( ; i < (n+1)/2; i++)
    {
        if(s[i] == s[n-i-1])
        {
            mi++;
            ma--;
            continue;
        }

        rez+=2;
        rez1+=2;
        cout << "check\n";
        for(int j = ma; j > i; j--)
        {
            if(s[i]==s[j] && j != n-j-1)
            {
                bool f = 1;
                for(int k = 0; k<v.size();k++)
                    if(v[k]==j)
                    {
                        f=0;
                        break;
                    }
                if(f)
                {
                    cout << "check1\n";
                    v.push_back(j);
                    rez--;
                }
            }

        }
        for(int j = mi; j < n-i-1; j++)
        {
            if(s[n-i-1]==s[j])
            {
                bool f = 1;
                for(int k = 0; k<v1.size();k++)
                    if(v1[k]==j)
                    {
                        f=0;
                        break;
                    }
                if(f)
                {
                    cout << "check2\n";
                    v1.push_back(j);
                    rez1--;
                }
            }

        }
    }
    rez = min(rez, rez1);
    if(rez-mi==(n+1)/2 && g)
        rez--;

    if(rez==0)
        cout << 1;
    else
        cout << rez;
}