using System;
using System.Collections.Generic;
class Program
{
    static void Main(string[] args)
    {
        //入力の受け取り
        char[] input = ReadChar();

        //配列→list
        List<char> numList = new List<char>();
        for (int jj = 0; jj < input.Length; jj++)
        {
            numList.Add(input[jj]);
        }

        //隣合う0と1を取り除いてカウントしていく
        int answer = Puyo(numList);

        //回答提出
        Console.WriteLine(answer);

    }

    static int Puyo(IEnumerable<string> numList)
    {
        int answer = 0;
        for (int ii = 0; ii < numList.Count - 1; ii++)
        {
            if (numList[ii] != numList[ii + 1])
            {
                numList.RemoveAt(ii);
                numList.RemoveAt(ii);
                answer = answer + 2;
                if (ii < 2)
                {
                    ii = -1;
                }
                else
                {
                    ii = ii - 2;
                }
            }
        }

        return answer;
    }

    //読み取り用
    static String Read()
    {
        return Console.ReadLine();
    }

    static int ReadInt()
    {
        return int.Parse(Console.ReadLine());
    }

    static char[] ReadChar()
    {
        return Console.ReadLine().ToCharArray();
    }


}