import java.util.*;
class Main 
{ 

	
	 
	public static void main(String args[]) 
	{ 
		Scanner s = new Scanner(System.in);
		char[] c = s.next().toCharArray();
		int one=0;
		for(int i=0;i<c.length;i++)
		{
			if(c[i]=='1')
			{
				one++;
			}
			else
			{
				one--;
			}
		}
		System.out.println(c.length-Math.abs(one));

		
		
		
	}
}  import java.util.*; util.* java class Main 
{ 

	
	 
	public static void main(String args[]) 
	{ 
		Scanner s = new Scanner(System.in);
		char[] c = s.next().toCharArray();
		int one=0;
		for(int i=0;i<c.length;i++)
		{
			if(c[i]=='1')
			{
				one++;
			}
			else
			{
				one--;
			}
		}
		System.out.println(c.length-Math.abs(one));

		
		
		
	}
} Main public static void main(String args[]) 
	{ 
		Scanner s = new Scanner(System.in);
		char[] c = s.next().toCharArray();
		int one=0;
		for(int i=0;i<c.length;i++)
		{
			if(c[i]=='1')
			{
				one++;
			}
			else
			{
				one--;
			}
		}
		System.out.println(c.length-Math.abs(one));

		
		
		
	} main { 
		Scanner s = new Scanner(System.in);
		char[] c = s.next().toCharArray();
		int one=0;
		for(int i=0;i<c.length;i++)
		{
			if(c[i]=='1')
			{
				one++;
			}
			else
			{
				one--;
			}
		}
		System.out.println(c.length-Math.abs(one));

		
		
		
	} Scanner s = new Scanner(System.in); s new Scanner(System.in) char[] c = s.next().toCharArray(); c s.next().toCharArray() s.next().toCharArray s.next() s.next s int one=0; one 0 for(int i=0;i<c.length;i++)
		{
			if(c[i]=='1')
			{
				one++;
			}
			else
			{
				one--;
			}
		} int i=0; int i=0; i 0 i<c.length i c.length c c.length i++ i++ i {
			if(c[i]=='1')
			{
				one++;
			}
			else
			{
				one--;
			}
		} {
			if(c[i]=='1')
			{
				one++;
			}
			else
			{
				one--;
			}
		} if(c[i]=='1')
			{
				one++;
			}
			else
			{
				one--;
			} c[i]=='1' c[i] c i '1' {
				one++;
			} one++ one {
				one--;
			} one-- one System.out.println(c.length-Math.abs(one)) System.out.println System.out System System.out c.length-Math.abs(one) c.length c c.length Math.abs(one) Math.abs Math one String args[] args
import java.util.*;
class Main 
{ 

	
	 
	public static void main(String args[]) 
	{ 
		Scanner s = new Scanner(System.in);
		char[] c = s.next().toCharArray();
		int one=0;
		for(int i=0;i<c.length;i++)
		{
			if(c[i]=='1')
			{
				one++;
			}
			else
			{
				one--;
			}
		}
		System.out.println(c.length-Math.abs(one));

		
		
		
	}
} 
