import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		sc.close();
		int k = 0;
		for(int i = 0; i < S.length(); i++) {
			if(S.charAt(i) == '0') {
				k++;
			}else {
				k--;
			}
		}
		System.out.println(S.length() - Math.abs(k));
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		sc.close();
		int k = 0;
		for(int i = 0; i < S.length(); i++) {
			if(S.charAt(i) == '0') {
				k++;
			}else {
				k--;
			}
		}
		System.out.println(S.length() - Math.abs(k));
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		sc.close();
		int k = 0;
		for(int i = 0; i < S.length(); i++) {
			if(S.charAt(i) == '0') {
				k++;
			}else {
				k--;
			}
		}
		System.out.println(S.length() - Math.abs(k));
	} main {
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		sc.close();
		int k = 0;
		for(int i = 0; i < S.length(); i++) {
			if(S.charAt(i) == '0') {
				k++;
			}else {
				k--;
			}
		}
		System.out.println(S.length() - Math.abs(k));
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String S = sc.next(); S sc.next() sc.next sc sc.close() sc.close sc int k = 0; k 0 for(int i = 0; i < S.length(); i++) {
			if(S.charAt(i) == '0') {
				k++;
			}else {
				k--;
			}
		} int i = 0; int i = 0; i 0 i < S.length() i S.length() S.length S i++ i++ i {
			if(S.charAt(i) == '0') {
				k++;
			}else {
				k--;
			}
		} {
			if(S.charAt(i) == '0') {
				k++;
			}else {
				k--;
			}
		} if(S.charAt(i) == '0') {
				k++;
			}else {
				k--;
			} S.charAt(i) == '0' S.charAt(i) S.charAt S i '0' {
				k++;
			} k++ k {
				k--;
			} k-- k System.out.println(S.length() - Math.abs(k)) System.out.println System.out System System.out S.length() - Math.abs(k) S.length() S.length S Math.abs(k) Math.abs Math k String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		sc.close();
		int k = 0;
		for(int i = 0; i < S.length(); i++) {
			if(S.charAt(i) == '0') {
				k++;
			}else {
				k--;
			}
		}
		System.out.println(S.length() - Math.abs(k));
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		sc.close();
		int k = 0;
		for(int i = 0; i < S.length(); i++) {
			if(S.charAt(i) == '0') {
				k++;
			}else {
				k--;
			}
		}
		System.out.println(S.length() - Math.abs(k));
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		sc.close();
		int k = 0;
		for(int i = 0; i < S.length(); i++) {
			if(S.charAt(i) == '0') {
				k++;
			}else {
				k--;
			}
		}
		System.out.println(S.length() - Math.abs(k));
	}
}