using System;
using System.Collections.Generic;
 
class Program {
	static void Main (string[] args) {
    	int count = 0;
		string str = Console.ReadLine();
    	while (str.IndexOf("10") > 0 || str.IndexOf("01") > 0) {
        	int index = (str.IndexOf("10") > 0) ? str.IndexOf("10") : str.IndexOf("01");
        	string str_a = (index != 0) ? str.Substring(0, index) : "";
        	string str_b = (index + 1 != str.Length - 1) ? str.Substring(index + 2, str.Length - index - 2) : "";
        	str = str_a + str_b;
        	count += 2;
        }
    	Console.WriteLine(count);
	}
}