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

namespace CSharpScript
{
	class Program
	{
		static void Main(string[] args)
		{
			var input = Console.ReadLine();

			// var input = "001";

			var stack = new Stack<int>();
			var ans = 0;
			for (int i = 0; i < input.Length; i++)
			{
				var current = input[i];
				if (current == '0')
				{
					stack.Push(current);
				}
				else
				{
					if (stack.Count == 0)
					{
						continue;
					}
					var a = stack.Pop();
					if (a == '0')
					{
						ans++;
					}
				}
			}

			System.Console.WriteLine(ans * 2);
		}
	}
}