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

namespace AtCoder
{
    class Program
    {
        static void Main(string[] args)
        {
            var input = Console.ReadLine();
            var count = 0;
            while (true)
            {
                if (input.Contains("01"))
                {
                    input = input.Remove(input.IndexOf("01"), 2);
                    count++;
                }else if (input.Contains("10"))
                {
                    input = input.Remove(input.IndexOf("10"), 2);
                    count++;
                }
                else
                {
                    break;
                }
            }
            Console.WriteLine(count * 2);
        }
    }
}
