
import java.util.Arrays;
import java.util.Scanner;


public class Main {
	static long MOD = 1000000007;
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		char[] s = sc.next().toCharArray();
		Arrays.sort(s);
		StringBuilder sb = new StringBuilder();
		//append
		sb.append(s);

		int zeroind = sb.lastIndexOf("0") + 1;
		int oneind = sb.length()-zeroind;

		System.out.println(Math.min(zeroind,oneind)*2);

	}
} import java.util.Arrays; Arrays java.util import java.util.Scanner; Scanner java.util public class Main {
	static long MOD = 1000000007;
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		char[] s = sc.next().toCharArray();
		Arrays.sort(s);
		StringBuilder sb = new StringBuilder();
		//append
		sb.append(s);

		int zeroind = sb.lastIndexOf("0") + 1;
		int oneind = sb.length()-zeroind;

		System.out.println(Math.min(zeroind,oneind)*2);

	}
} Main static long MOD = 1000000007; MOD 1000000007 public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		char[] s = sc.next().toCharArray();
		Arrays.sort(s);
		StringBuilder sb = new StringBuilder();
		//append
		sb.append(s);

		int zeroind = sb.lastIndexOf("0") + 1;
		int oneind = sb.length()-zeroind;

		System.out.println(Math.min(zeroind,oneind)*2);

	} main {
		Scanner sc = new Scanner(System.in);
		char[] s = sc.next().toCharArray();
		Arrays.sort(s);
		StringBuilder sb = new StringBuilder();
		//append
		sb.append(s);

		int zeroind = sb.lastIndexOf("0") + 1;
		int oneind = sb.length()-zeroind;

		System.out.println(Math.min(zeroind,oneind)*2);

	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) char[] s = sc.next().toCharArray(); s sc.next().toCharArray() sc.next().toCharArray sc.next() sc.next sc Arrays.sort(s) Arrays.sort Arrays s StringBuilder sb = new StringBuilder(); sb new StringBuilder() sb.append(s) sb.append sb s int zeroind = sb.lastIndexOf("0") + 1; zeroind sb.lastIndexOf("0") + 1 sb.lastIndexOf("0") sb.lastIndexOf sb "0" 1 int oneind = sb.length()-zeroind; oneind sb.length()-zeroind sb.length() sb.length sb zeroind System.out.println(Math.min(zeroind,oneind)*2) System.out.println System.out System System.out Math.min(zeroind,oneind)*2 Math.min(zeroind,oneind) Math.min Math zeroind oneind 2 String[] args args public class Main {
	static long MOD = 1000000007;
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		char[] s = sc.next().toCharArray();
		Arrays.sort(s);
		StringBuilder sb = new StringBuilder();
		//append
		sb.append(s);

		int zeroind = sb.lastIndexOf("0") + 1;
		int oneind = sb.length()-zeroind;

		System.out.println(Math.min(zeroind,oneind)*2);

	}
} public class Main {
	static long MOD = 1000000007;
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		char[] s = sc.next().toCharArray();
		Arrays.sort(s);
		StringBuilder sb = new StringBuilder();
		//append
		sb.append(s);

		int zeroind = sb.lastIndexOf("0") + 1;
		int oneind = sb.length()-zeroind;

		System.out.println(Math.min(zeroind,oneind)*2);

	}
} Main

import java.util.Arrays;
import java.util.Scanner;


public class Main {
	static long MOD = 1000000007;
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		char[] s = sc.next().toCharArray();
		Arrays.sort(s);
		StringBuilder sb = new StringBuilder();
		//append
		sb.append(s);

		int zeroind = sb.lastIndexOf("0") + 1;
		int oneind = sb.length()-zeroind;

		System.out.println(Math.min(zeroind,oneind)*2);

	}
}
