using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Main
{
    public static class Program
    {
        public static List<char> chlist = new List<char>();

        static void Main(string[] arg)
        {
            var answer = 0;

            //var line = GetIntList(Console.ReadLine());
            var ch = Console.ReadLine().ToCharArray();
            chlist.AddRange(ch);
            int original_length = chlist.Count();

            int zero = chlist.Count(value => value == '0');
            int one = chlist.Count(value => value == '1');
            answer = chlist.Count() - Math.Abs(zero - one);


            Console.WriteLine(answer);
            Console.ReadLine();

        }
        }
        #region libraries
        private static int[] GetIntList(string line)
        {
            return line.Split(' ').Select(x => int.Parse(x)).ToArray();

        }
        private static double[] GetDoubleList(string line)
        {
            return line.Split(' ').Select(x => double.Parse(x)).ToArray();

        }
        private static int SearchNearest(this IEnumerable<int> list, int target)
        {
            var min = list.Min(c => Math.Abs(c - target));
            return list.First(c => Math.Abs(c - target) == min);
        }
        public static int Gcd(int a,int b)
        {
            if(a < b)
            {
                Gcd(b, a);
            }
            while (b != 0)
            {
                var rm = a % b;
                a = b;
                b = rm;
            }
            return a;
        }
        #endregion
    }
}
