import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		int a = 0, b = 0;
		int num = 0;
		for(int i = 0;i < s.length(); i++) {
			if((s.charAt(i)) == ('1')){
				a++;
			}else {
				b++;
			}
		}
		if(a == b) {
			num = s.length();
		}else if(a<b) {
			num = b-a;
			num = s.length() - num;
		}else {
			num = a-b;
			num = s.length() - num;
		}
		System.out.println(num);
	}

} 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();
		int a = 0, b = 0;
		int num = 0;
		for(int i = 0;i < s.length(); i++) {
			if((s.charAt(i)) == ('1')){
				a++;
			}else {
				b++;
			}
		}
		if(a == b) {
			num = s.length();
		}else if(a<b) {
			num = b-a;
			num = s.length() - num;
		}else {
			num = a-b;
			num = s.length() - num;
		}
		System.out.println(num);
	}

} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		int a = 0, b = 0;
		int num = 0;
		for(int i = 0;i < s.length(); i++) {
			if((s.charAt(i)) == ('1')){
				a++;
			}else {
				b++;
			}
		}
		if(a == b) {
			num = s.length();
		}else if(a<b) {
			num = b-a;
			num = s.length() - num;
		}else {
			num = a-b;
			num = s.length() - num;
		}
		System.out.println(num);
	} main {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		int a = 0, b = 0;
		int num = 0;
		for(int i = 0;i < s.length(); i++) {
			if((s.charAt(i)) == ('1')){
				a++;
			}else {
				b++;
			}
		}
		if(a == b) {
			num = s.length();
		}else if(a<b) {
			num = b-a;
			num = s.length() - num;
		}else {
			num = a-b;
			num = s.length() - num;
		}
		System.out.println(num);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String s = sc.next(); s sc.next() sc.next sc int a = 0 a 0 b = 0; b 0 int num = 0; num 0 for(int i = 0;i < s.length(); i++) {
			if((s.charAt(i)) == ('1')){
				a++;
			}else {
				b++;
			}
		} int i = 0; int i = 0; i 0 i < s.length() i s.length() s.length s i++ i++ i {
			if((s.charAt(i)) == ('1')){
				a++;
			}else {
				b++;
			}
		} {
			if((s.charAt(i)) == ('1')){
				a++;
			}else {
				b++;
			}
		} if((s.charAt(i)) == ('1')){
				a++;
			}else {
				b++;
			} (s.charAt(i)) == ('1') (s.charAt(i)) s.charAt s i ('1') {
				a++;
			} a++ a {
				b++;
			} b++ b if(a == b) {
			num = s.length();
		}else if(a<b) {
			num = b-a;
			num = s.length() - num;
		}else {
			num = a-b;
			num = s.length() - num;
		} a == b a b {
			num = s.length();
		} num = s.length() num s.length() s.length s if(a<b) {
			num = b-a;
			num = s.length() - num;
		}else {
			num = a-b;
			num = s.length() - num;
		} a<b a b {
			num = b-a;
			num = s.length() - num;
		} num = b-a num b-a b a num = s.length() - num num s.length() - num s.length() s.length s num {
			num = a-b;
			num = s.length() - num;
		} num = a-b num a-b a b num = s.length() - num num s.length() - num s.length() s.length s num System.out.println(num) System.out.println System.out System System.out num String[] args args public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		int a = 0, b = 0;
		int num = 0;
		for(int i = 0;i < s.length(); i++) {
			if((s.charAt(i)) == ('1')){
				a++;
			}else {
				b++;
			}
		}
		if(a == b) {
			num = s.length();
		}else if(a<b) {
			num = b-a;
			num = s.length() - num;
		}else {
			num = a-b;
			num = s.length() - num;
		}
		System.out.println(num);
	}

} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		int a = 0, b = 0;
		int num = 0;
		for(int i = 0;i < s.length(); i++) {
			if((s.charAt(i)) == ('1')){
				a++;
			}else {
				b++;
			}
		}
		if(a == b) {
			num = s.length();
		}else if(a<b) {
			num = b-a;
			num = s.length() - num;
		}else {
			num = a-b;
			num = s.length() - num;
		}
		System.out.println(num);
	}

} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		int a = 0, b = 0;
		int num = 0;
		for(int i = 0;i < s.length(); i++) {
			if((s.charAt(i)) == ('1')){
				a++;
			}else {
				b++;
			}
		}
		if(a == b) {
			num = s.length();
		}else if(a<b) {
			num = b-a;
			num = s.length() - num;
		}else {
			num = a-b;
			num = s.length() - num;
		}
		System.out.println(num);
	}

}
