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_b = str;
        	List<char> chars = new List<char>();
        	for (int cnt = 0; cnt < str_b.Length; cnt++) {
            	if (cnt == index || cnt == index + 1) {
                	continue;
                }
            	chars.Add(str_b[cnt]);
            }
        	str = "";
        	foreach (char c in chars) {
            	str += c;
            }
        	count += 2;
        }
    	Console.WriteLine(count);
	}
}