using System;

class Plogram
{
    static void Main()
    {

        var S = Console.ReadLine();

        int count = 0;

        while(true)
        {
            for (int i = 0; i < S.Length - 1; i++)
            {
                if(S.Substring(i,1) != S.Substring(i+1,1))
                {
                    S = S.Remove(i, 2);
                    count += 2;
                    break;
                }


            }

            if (S.Contains("0") == false || S.Contains("1") == false)
            {
                break;
            }
        }

        Console.WriteLine(count);
    }
}