import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scn = new Scanner(System.in);
		String s = scn.next();
		int b = s.replaceAll("0", "").length();
		int r = s.length()-b;
		System.out.println(s.length()-Math.abs(b-r));
		scn.close();
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner scn = new Scanner(System.in);
		String s = scn.next();
		int b = s.replaceAll("0", "").length();
		int r = s.length()-b;
		System.out.println(s.length()-Math.abs(b-r));
		scn.close();
	}
} Main public static void main(String[] args) {
		Scanner scn = new Scanner(System.in);
		String s = scn.next();
		int b = s.replaceAll("0", "").length();
		int r = s.length()-b;
		System.out.println(s.length()-Math.abs(b-r));
		scn.close();
	} main {
		Scanner scn = new Scanner(System.in);
		String s = scn.next();
		int b = s.replaceAll("0", "").length();
		int r = s.length()-b;
		System.out.println(s.length()-Math.abs(b-r));
		scn.close();
	} Scanner scn = new Scanner(System.in); scn new Scanner(System.in) String s = scn.next(); s scn.next() scn.next scn int b = s.replaceAll("0", "").length(); b s.replaceAll("0", "").length() s.replaceAll("0", "").length s.replaceAll("0", "") s.replaceAll s "0" "" int r = s.length()-b; r s.length()-b s.length() s.length s b System.out.println(s.length()-Math.abs(b-r)) System.out.println System.out System System.out s.length()-Math.abs(b-r) s.length() s.length s Math.abs(b-r) Math.abs Math b-r b r scn.close() scn.close scn String[] args args public class Main {
	public static void main(String[] args) {
		Scanner scn = new Scanner(System.in);
		String s = scn.next();
		int b = s.replaceAll("0", "").length();
		int r = s.length()-b;
		System.out.println(s.length()-Math.abs(b-r));
		scn.close();
	}
} public class Main {
	public static void main(String[] args) {
		Scanner scn = new Scanner(System.in);
		String s = scn.next();
		int b = s.replaceAll("0", "").length();
		int r = s.length()-b;
		System.out.println(s.length()-Math.abs(b-r));
		scn.close();
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scn = new Scanner(System.in);
		String s = scn.next();
		int b = s.replaceAll("0", "").length();
		int r = s.length()-b;
		System.out.println(s.length()-Math.abs(b-r));
		scn.close();
	}
}