import java.util.*;

public class Main
{
	public static void main (String[] args)
	{
		Scanner sc = new Scanner (System.in);
		String str = sc.nextLine();
		int n = str.length();
		int red = 0;
		int blue = 0;

		//0=red	1=blue

			for (int i = 0; i < n; i++)
			{
				if (str.substring (i,i+1).equals ("0"))
					red++;
				else
					blue++;
			}

		int ans = 0;
		if (red>blue)
			ans = n-(red-blue);
		else
			ans = n-(blue-red);
		System.out.println (ans);
	}
} import java.util.*; util.* java public class Main
{
	public static void main (String[] args)
	{
		Scanner sc = new Scanner (System.in);
		String str = sc.nextLine();
		int n = str.length();
		int red = 0;
		int blue = 0;

		//0=red	1=blue

			for (int i = 0; i < n; i++)
			{
				if (str.substring (i,i+1).equals ("0"))
					red++;
				else
					blue++;
			}

		int ans = 0;
		if (red>blue)
			ans = n-(red-blue);
		else
			ans = n-(blue-red);
		System.out.println (ans);
	}
} Main public static void main (String[] args)
	{
		Scanner sc = new Scanner (System.in);
		String str = sc.nextLine();
		int n = str.length();
		int red = 0;
		int blue = 0;

		//0=red	1=blue

			for (int i = 0; i < n; i++)
			{
				if (str.substring (i,i+1).equals ("0"))
					red++;
				else
					blue++;
			}

		int ans = 0;
		if (red>blue)
			ans = n-(red-blue);
		else
			ans = n-(blue-red);
		System.out.println (ans);
	} main {
		Scanner sc = new Scanner (System.in);
		String str = sc.nextLine();
		int n = str.length();
		int red = 0;
		int blue = 0;

		//0=red	1=blue

			for (int i = 0; i < n; i++)
			{
				if (str.substring (i,i+1).equals ("0"))
					red++;
				else
					blue++;
			}

		int ans = 0;
		if (red>blue)
			ans = n-(red-blue);
		else
			ans = n-(blue-red);
		System.out.println (ans);
	} Scanner sc = new Scanner (System.in); sc new Scanner (System.in) String str = sc.nextLine(); str sc.nextLine() sc.nextLine sc int n = str.length(); n str.length() str.length str int red = 0; red 0 int blue = 0; blue 0 for (int i = 0; i < n; i++)
			{
				if (str.substring (i,i+1).equals ("0"))
					red++;
				else
					blue++;
			} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
				if (str.substring (i,i+1).equals ("0"))
					red++;
				else
					blue++;
			} {
				if (str.substring (i,i+1).equals ("0"))
					red++;
				else
					blue++;
			} if (str.substring (i,i+1).equals ("0"))
					red++;
				else
					blue++; str.substring (i,i+1).equals ("0") str.substring (i,i+1).equals str.substring (i,i+1) str.substring str i i+1 i 1 "0" red++ red blue++ blue int ans = 0; ans 0 if (red>blue)
			ans = n-(red-blue);
		else
			ans = n-(blue-red); red>blue red blue ans = n-(red-blue) ans n-(red-blue) n (red-blue) red blue ans = n-(blue-red) ans n-(blue-red) n (blue-red) blue red System.out.println (ans) System.out.println System.out System System.out ans String[] args args public class Main
{
	public static void main (String[] args)
	{
		Scanner sc = new Scanner (System.in);
		String str = sc.nextLine();
		int n = str.length();
		int red = 0;
		int blue = 0;

		//0=red	1=blue

			for (int i = 0; i < n; i++)
			{
				if (str.substring (i,i+1).equals ("0"))
					red++;
				else
					blue++;
			}

		int ans = 0;
		if (red>blue)
			ans = n-(red-blue);
		else
			ans = n-(blue-red);
		System.out.println (ans);
	}
} public class Main
{
	public static void main (String[] args)
	{
		Scanner sc = new Scanner (System.in);
		String str = sc.nextLine();
		int n = str.length();
		int red = 0;
		int blue = 0;

		//0=red	1=blue

			for (int i = 0; i < n; i++)
			{
				if (str.substring (i,i+1).equals ("0"))
					red++;
				else
					blue++;
			}

		int ans = 0;
		if (red>blue)
			ans = n-(red-blue);
		else
			ans = n-(blue-red);
		System.out.println (ans);
	}
} Main
import java.util.*;

public class Main
{
	public static void main (String[] args)
	{
		Scanner sc = new Scanner (System.in);
		String str = sc.nextLine();
		int n = str.length();
		int red = 0;
		int blue = 0;

		//0=red	1=blue

			for (int i = 0; i < n; i++)
			{
				if (str.substring (i,i+1).equals ("0"))
					red++;
				else
					blue++;
			}

		int ans = 0;
		if (red>blue)
			ans = n-(red-blue);
		else
			ans = n-(blue-red);
		System.out.println (ans);
	}
}