using System;
using System.Collections.Generic;
using System.Linq;

namespace Takmicenje
{
    class MainClass
    {
        static string Reverse(string s)
        {
            string s1 = new string(s.ToCharArray().Reverse().ToArray());
            return s1;
        }
        public static void Main(string[] args)
        {
            string s = Console.ReadLine();

            string s1 = Reverse(s);

            if (s == s1 && s.Length % 2 == 0)
            {
                Console.WriteLine(s.Length / 2);
                Environment.Exit(0);
            }
            else if (s == s1)
            {
                Console.WriteLine(0);
                Environment.Exit(0);
            }

            char[] vs = s.Distinct().ToArray();
            int q = vs.Length;
            int[] vs1 = new int[q];
            for (int i = 0; i < s.Length; i++)
            {
                for (int j = 0; j < q; j++)
                {
                    if (s[i] == vs[j])
                    {
                        vs1[j]++;
                    }
                }
            }

            int poeni = 0;

            for (int i = 0; i < s.Length; i++) 
            {
                for (int j = 0; j < q; j++)
                {
                    if (vs1[j] > 1 && vs[j] == s[i] && i != s.Length - 1)
                    {
                        int pocetak = i + 1, duzina = 0;

                        for (int k = pocetak; k < s.Length; k++)
                        {
                            if (vs[j] == s[k])
                                break;
                            duzina++;
                        }

                        if (duzina % 2 == 0)
                            poeni++;
                    }
                }
            }

            Console.WriteLine(poeni);
        }
    }
}