using System;
using System.Linq;

public class Program
{
    static void Main()
    {
        var vals = Console.ReadLine().Select(x => int.Parse(x.ToString())).ToList();
        var memo = new bool[vals.Count].Select(x => false).ToArray();
        for (int i = 0; i < vals.Count; i++)
        {
            for (int j = i - 1; j > -1; j--)
            {
                if (memo[j] == false && vals[i] != vals[j])
                {
                    memo[i] = true;
                    memo[j] = true;
                    break;
                }
            }
        }

        Console.WriteLine(memo.Where(x => x == true).Count());
    }
}