import java.util.Scanner;

final class Solver {
	static final Solver INSTANCE = new Solver();

	void solve(Scanner sc) {
		String S = sc.next();
		char[] chars = S.toCharArray();
		int red = 0;
		int blue = 0;
		for (char ch : chars) {
			if (ch == '0') {
				red += 1;
			} else {
				blue += 1;
			}
		}
		System.out.println(S.length() - Math.abs(red - blue));
	}
}

class Main {
	public static void main(String... args) {
		Scanner in = new Scanner(System.in);

		Solver.INSTANCE.solve(in);

		in.close();
	}
} import java.util.Scanner; Scanner java.util final class Solver {
	static final Solver INSTANCE = new Solver();

	void solve(Scanner sc) {
		String S = sc.next();
		char[] chars = S.toCharArray();
		int red = 0;
		int blue = 0;
		for (char ch : chars) {
			if (ch == '0') {
				red += 1;
			} else {
				blue += 1;
			}
		}
		System.out.println(S.length() - Math.abs(red - blue));
	}
} Solver static final Solver INSTANCE = new Solver(); INSTANCE new Solver() void solve(Scanner sc) {
		String S = sc.next();
		char[] chars = S.toCharArray();
		int red = 0;
		int blue = 0;
		for (char ch : chars) {
			if (ch == '0') {
				red += 1;
			} else {
				blue += 1;
			}
		}
		System.out.println(S.length() - Math.abs(red - blue));
	} solve {
		String S = sc.next();
		char[] chars = S.toCharArray();
		int red = 0;
		int blue = 0;
		for (char ch : chars) {
			if (ch == '0') {
				red += 1;
			} else {
				blue += 1;
			}
		}
		System.out.println(S.length() - Math.abs(red - blue));
	} String S = sc.next(); S sc.next() sc.next sc char[] chars = S.toCharArray(); chars S.toCharArray() S.toCharArray S int red = 0; red 0 int blue = 0; blue 0 for (char ch : chars) {
			if (ch == '0') {
				red += 1;
			} else {
				blue += 1;
			}
		} char ch chars {
			if (ch == '0') {
				red += 1;
			} else {
				blue += 1;
			}
		} {
			if (ch == '0') {
				red += 1;
			} else {
				blue += 1;
			}
		} if (ch == '0') {
				red += 1;
			} else {
				blue += 1;
			} ch == '0' ch '0' {
				red += 1;
			} red += 1 red 1 {
				blue += 1;
			} blue += 1 blue 1 System.out.println(S.length() - Math.abs(red - blue)) System.out.println System.out System System.out S.length() - Math.abs(red - blue) S.length() S.length S Math.abs(red - blue) Math.abs Math red - blue red blue Scanner sc sc class Main {
	public static void main(String... args) {
		Scanner in = new Scanner(System.in);

		Solver.INSTANCE.solve(in);

		in.close();
	}
} Main public static void main(String... args) {
		Scanner in = new Scanner(System.in);

		Solver.INSTANCE.solve(in);

		in.close();
	} main {
		Scanner in = new Scanner(System.in);

		Solver.INSTANCE.solve(in);

		in.close();
	} Scanner in = new Scanner(System.in); in new Scanner(System.in) Solver.INSTANCE.solve(in) Solver.INSTANCE.solve Solver.INSTANCE Solver Solver.INSTANCE in in.close() in.close in String... args args
import java.util.Scanner;

final class Solver {
	static final Solver INSTANCE = new Solver();

	void solve(Scanner sc) {
		String S = sc.next();
		char[] chars = S.toCharArray();
		int red = 0;
		int blue = 0;
		for (char ch : chars) {
			if (ch == '0') {
				red += 1;
			} else {
				blue += 1;
			}
		}
		System.out.println(S.length() - Math.abs(red - blue));
	}
}

class Main {
	public static void main(String... args) {
		Scanner in = new Scanner(System.in);

		Solver.INSTANCE.solve(in);

		in.close();
	}
}