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

class Program
{
    static void Main(string[] args)
    {
        string s = Console.ReadLine();
        List<bool> cube = new List<bool>();
        for (int i = 0; i < s.Length; i++)
        {
            if (s[i] == '1') cube.Add(true);
            else cube.Add(false);
        }

        int t = 1;
        while (t < cube.Count)
        {
            if (cube.Count < 2) break;
            if (cube[t - 1] = cube[t])
            {
                cube.RemoveAt(t);
                cube.RemoveAt(t - 1);
                if (t > 1) t--;
            }
            else t++;
        }

        Console.WriteLine(s.Length - cube.Count);
    }
}