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

using E = System.Linq.Enumerable;

public class Program
{
    public static void Main()
    {
        var s = Console.ReadLine().Trim().Select(x => (int)x - '0').ToArray();

        var rest = 1;
        var color = s[0];
        var k = 0;
        for (int i = 1; i < s.Length; i++)
        {
            if (color + s[i] == 1)
            {
                rest--;
                k++;
                continue;
            }

            color = s[i];
            rest++;
        }
        Console.WriteLine(k * 2);
    }
}
