using System;

namespace C_Unification
{
    class Program
    {
        static void Main(string[] args)
        {
            var S = Console.ReadLine();
            int idx = 0, cnt = 0;

            while (S.IndexOf("01") != -1)
            {
                idx = S.IndexOf("01");
                S = S.Remove(idx, "01".Length);
                cnt += 2;
            }

            while(S.IndexOf("10") != -1)
            {
                idx = S.IndexOf("10");
                S = S.Remove(idx, "10".Length);
                cnt += 2;
            }

            Console.WriteLine(cnt);

        }
    }
}
