using System;
using System.Linq;
using System.Text;

public class Program
{
    static void Main()
    {
        var vals = Console.ReadLine().Select(x => int.Parse(x.ToString())).ToList();
        var count = 0;
        for (int i = 0; i < vals.Count - 1; i++)
        {
            if (vals[i] != vals[i + 1])
            {
                vals.RemoveRange(i, 2);
                count++;
                i = -1;
            }
        }

        Console.WriteLine(count * 2);
    }
}