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

class Program
{
    static void Main(string[] args)
    {
        var s = Console.ReadLine();
        var reg = new Regex("(01|10)");
        int i = 0;
        while (reg.IsMatch(s))
        {
            s = reg.Replace(s, m => { i++; return ""; });
        }
        Console.WriteLine(i * 2);
    }
}