#include <iostream>
#include <bits/stdc++.h>
#include <string>
using namespace std;

bool IsPalindrome(string a)
{
    int n = a.size();
    for(int i = 0; i < n;++i)
    {
        if(a[i] != a[n - i - 1])
            return false;
    }
    return true;

}

int howmanyareequal(string a)
{

    int n = a.size(), counter = 0, i = 0;
    while(a[i] == a[n -i - 1]){
        i++;
        counter++;
    }


    return counter;
}

int countDistinct(string s)
{

    unordered_map<char, int> m;

    for (int i = 0; i < s.length(); i++) {
        m[s[i]]++;
    }

    return m.size();
}
int main()
{
    cin.tie(0);
    ios_base::sync_with_stdio(false);

    string c;
    cin >> c;
    if(IsPalindrome(c))
        cout << 1;

    else{
        cout << c.size() - countDistinct(c);
    }

    return 0;
}