using System;

namespace c
{
    class Program
    {
        static void Main(string[] args)
        {
            var s = Console.ReadLine();

            var count = 0;
            while(true){
                var x = s.IndexOf("01");
                var y = s.IndexOf("10");
                if(x != -1){
                    count += 2;
                    s = s.Substring(0, x) + s.Substring(x + 2, s.Length - x - 2);
                }else if(y != -1){
                    count += 2;
                    s = s.Substring(0, y) + s.Substring(y + 2, s.Length - y - 2);
                }

                if(x == -1 && y == -1){
                    break;
                }
            }
            Console.WriteLine(count);
        }
    }
}
