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

namespace _01
{
    class Program
    {
        static void Main(string[] args)
        {
            string s = Console.ReadLine();
            int zero = s.Length - s.Replace(0.ToString(), "").Length;
            int one = s.Length - s.Replace(1.ToString(), "").Length;
            Console.WriteLine(Math.Abs(zero - one));
        }
    }
}