using System;
 
class Program {
	static void Main (string[] args) {
    	int count = 0;
		string str = Console.ReadLine();
    	int num = str.Length;
    	while (str.IndexOf("10") > 0 || str.IndexOf("01") > 0) {
        	str = str.Replace("10", "");
        	str = str.Replace("01", "");
        }
    	int num_aft = num - str.Length;
    	Console.WriteLine(num_aft);
	}
}