#include <stdio.h>
#include <string.h>
#include <math.h>
int istiChar(char t[200000], int j, int i)
{
    int p;
    for (p = j - 1; p != i && p >= 0; p--)
        if (t[i] == t[p])
            return p;
    return 0;
}
void swap(char t[200000], int i, int j)
{
    char pom;
    pom = t[i];
    t[i] = t[j];
    t[j] = pom;
}
int main()
{
    char t[200000];
    int i, l, j, br = 0, ok = 0, m;

    gets(t);

    l = strlen(t);
    for (i = 0, j = l - 1; i < l && j >= 0; i++, j--)
    {
        if (t[i] != t[j])
        {

            m = istiChar(t, j, i);
            swap(t, m, j);

            j--;
            i++;
            br++;
            ok = 0;
        }
    }
    if (ok != 0)
        br = 0;
    printf("%d", br + 1);
    return 0;
}