import java.util.*;

public class Main {
	
	static int result = 0;

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		String s = sc.nextLine();
		String[] strArray = s.split("");
		
		int zero = 0;
		int one = 0;
		for(int tmp = 0; tmp < strArray.length ; tmp++) {
			if(Integer.parseInt(strArray[tmp]) == 0) {
				one += 1;
			}else {
				zero += 1;
			}
		}
		System.out.println(strArray.length - Math.abs(zero - one));
	}
} import java.util.*; util.* java public class Main {
	
	static int result = 0;

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		String s = sc.nextLine();
		String[] strArray = s.split("");
		
		int zero = 0;
		int one = 0;
		for(int tmp = 0; tmp < strArray.length ; tmp++) {
			if(Integer.parseInt(strArray[tmp]) == 0) {
				one += 1;
			}else {
				zero += 1;
			}
		}
		System.out.println(strArray.length - Math.abs(zero - one));
	}
} Main static int result = 0; result 0 public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		String s = sc.nextLine();
		String[] strArray = s.split("");
		
		int zero = 0;
		int one = 0;
		for(int tmp = 0; tmp < strArray.length ; tmp++) {
			if(Integer.parseInt(strArray[tmp]) == 0) {
				one += 1;
			}else {
				zero += 1;
			}
		}
		System.out.println(strArray.length - Math.abs(zero - one));
	} main {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		String s = sc.nextLine();
		String[] strArray = s.split("");
		
		int zero = 0;
		int one = 0;
		for(int tmp = 0; tmp < strArray.length ; tmp++) {
			if(Integer.parseInt(strArray[tmp]) == 0) {
				one += 1;
			}else {
				zero += 1;
			}
		}
		System.out.println(strArray.length - Math.abs(zero - one));
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String s = sc.nextLine(); s sc.nextLine() sc.nextLine sc String[] strArray = s.split(""); strArray s.split("") s.split s "" int zero = 0; zero 0 int one = 0; one 0 for(int tmp = 0; tmp < strArray.length ; tmp++) {
			if(Integer.parseInt(strArray[tmp]) == 0) {
				one += 1;
			}else {
				zero += 1;
			}
		} int tmp = 0; int tmp = 0; tmp 0 tmp < strArray.length tmp strArray.length strArray strArray.length tmp++ tmp++ tmp {
			if(Integer.parseInt(strArray[tmp]) == 0) {
				one += 1;
			}else {
				zero += 1;
			}
		} {
			if(Integer.parseInt(strArray[tmp]) == 0) {
				one += 1;
			}else {
				zero += 1;
			}
		} if(Integer.parseInt(strArray[tmp]) == 0) {
				one += 1;
			}else {
				zero += 1;
			} Integer.parseInt(strArray[tmp]) == 0 Integer.parseInt(strArray[tmp]) Integer.parseInt Integer strArray[tmp] strArray tmp 0 {
				one += 1;
			} one += 1 one 1 {
				zero += 1;
			} zero += 1 zero 1 System.out.println(strArray.length - Math.abs(zero - one)) System.out.println System.out System System.out strArray.length - Math.abs(zero - one) strArray.length strArray strArray.length Math.abs(zero - one) Math.abs Math zero - one zero one String[] args args public class Main {
	
	static int result = 0;

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		String s = sc.nextLine();
		String[] strArray = s.split("");
		
		int zero = 0;
		int one = 0;
		for(int tmp = 0; tmp < strArray.length ; tmp++) {
			if(Integer.parseInt(strArray[tmp]) == 0) {
				one += 1;
			}else {
				zero += 1;
			}
		}
		System.out.println(strArray.length - Math.abs(zero - one));
	}
} public class Main {
	
	static int result = 0;

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		String s = sc.nextLine();
		String[] strArray = s.split("");
		
		int zero = 0;
		int one = 0;
		for(int tmp = 0; tmp < strArray.length ; tmp++) {
			if(Integer.parseInt(strArray[tmp]) == 0) {
				one += 1;
			}else {
				zero += 1;
			}
		}
		System.out.println(strArray.length - Math.abs(zero - one));
	}
} Main
import java.util.*;

public class Main {
	
	static int result = 0;

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		String s = sc.nextLine();
		String[] strArray = s.split("");
		
		int zero = 0;
		int one = 0;
		for(int tmp = 0; tmp < strArray.length ; tmp++) {
			if(Integer.parseInt(strArray[tmp]) == 0) {
				one += 1;
			}else {
				zero += 1;
			}
		}
		System.out.println(strArray.length - Math.abs(zero - one));
	}
}