import java.util.Scanner;

public class Main {
	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		char[] s1 = sc.next().toCharArray();
		int ans = 0;
		int c1 = 0;
		int c0 = 0;
		for(int i = 0; i < s1.length; i++) {
			if(s1[i] == '1') {
				if(c0 > 0) {
					c0--;
					ans++;
				}else {
					c1++;
				}
			}else {
				if(c1 > 0) {
					c1--;
					ans++;
				}else {
					c0++;
				}
			}
		}
		
		System.out.println(ans * 2);
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		char[] s1 = sc.next().toCharArray();
		int ans = 0;
		int c1 = 0;
		int c0 = 0;
		for(int i = 0; i < s1.length; i++) {
			if(s1[i] == '1') {
				if(c0 > 0) {
					c0--;
					ans++;
				}else {
					c1++;
				}
			}else {
				if(c1 > 0) {
					c1--;
					ans++;
				}else {
					c0++;
				}
			}
		}
		
		System.out.println(ans * 2);
	}
} Main public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		char[] s1 = sc.next().toCharArray();
		int ans = 0;
		int c1 = 0;
		int c0 = 0;
		for(int i = 0; i < s1.length; i++) {
			if(s1[i] == '1') {
				if(c0 > 0) {
					c0--;
					ans++;
				}else {
					c1++;
				}
			}else {
				if(c1 > 0) {
					c1--;
					ans++;
				}else {
					c0++;
				}
			}
		}
		
		System.out.println(ans * 2);
	} main {
		Scanner sc = new Scanner(System.in);
		char[] s1 = sc.next().toCharArray();
		int ans = 0;
		int c1 = 0;
		int c0 = 0;
		for(int i = 0; i < s1.length; i++) {
			if(s1[i] == '1') {
				if(c0 > 0) {
					c0--;
					ans++;
				}else {
					c1++;
				}
			}else {
				if(c1 > 0) {
					c1--;
					ans++;
				}else {
					c0++;
				}
			}
		}
		
		System.out.println(ans * 2);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) char[] s1 = sc.next().toCharArray(); s1 sc.next().toCharArray() sc.next().toCharArray sc.next() sc.next sc int ans = 0; ans 0 int c1 = 0; c1 0 int c0 = 0; c0 0 for(int i = 0; i < s1.length; i++) {
			if(s1[i] == '1') {
				if(c0 > 0) {
					c0--;
					ans++;
				}else {
					c1++;
				}
			}else {
				if(c1 > 0) {
					c1--;
					ans++;
				}else {
					c0++;
				}
			}
		} int i = 0; int i = 0; i 0 i < s1.length i s1.length s1 s1.length i++ i++ i {
			if(s1[i] == '1') {
				if(c0 > 0) {
					c0--;
					ans++;
				}else {
					c1++;
				}
			}else {
				if(c1 > 0) {
					c1--;
					ans++;
				}else {
					c0++;
				}
			}
		} {
			if(s1[i] == '1') {
				if(c0 > 0) {
					c0--;
					ans++;
				}else {
					c1++;
				}
			}else {
				if(c1 > 0) {
					c1--;
					ans++;
				}else {
					c0++;
				}
			}
		} if(s1[i] == '1') {
				if(c0 > 0) {
					c0--;
					ans++;
				}else {
					c1++;
				}
			}else {
				if(c1 > 0) {
					c1--;
					ans++;
				}else {
					c0++;
				}
			} s1[i] == '1' s1[i] s1 i '1' {
				if(c0 > 0) {
					c0--;
					ans++;
				}else {
					c1++;
				}
			} if(c0 > 0) {
					c0--;
					ans++;
				}else {
					c1++;
				} c0 > 0 c0 0 {
					c0--;
					ans++;
				} c0-- c0 ans++ ans {
					c1++;
				} c1++ c1 {
				if(c1 > 0) {
					c1--;
					ans++;
				}else {
					c0++;
				}
			} if(c1 > 0) {
					c1--;
					ans++;
				}else {
					c0++;
				} c1 > 0 c1 0 {
					c1--;
					ans++;
				} c1-- c1 ans++ ans {
					c0++;
				} c0++ c0 System.out.println(ans * 2) System.out.println System.out System System.out ans * 2 ans 2 String args[] args public class Main {
	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		char[] s1 = sc.next().toCharArray();
		int ans = 0;
		int c1 = 0;
		int c0 = 0;
		for(int i = 0; i < s1.length; i++) {
			if(s1[i] == '1') {
				if(c0 > 0) {
					c0--;
					ans++;
				}else {
					c1++;
				}
			}else {
				if(c1 > 0) {
					c1--;
					ans++;
				}else {
					c0++;
				}
			}
		}
		
		System.out.println(ans * 2);
	}
} public class Main {
	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		char[] s1 = sc.next().toCharArray();
		int ans = 0;
		int c1 = 0;
		int c0 = 0;
		for(int i = 0; i < s1.length; i++) {
			if(s1[i] == '1') {
				if(c0 > 0) {
					c0--;
					ans++;
				}else {
					c1++;
				}
			}else {
				if(c1 > 0) {
					c1--;
					ans++;
				}else {
					c0++;
				}
			}
		}
		
		System.out.println(ans * 2);
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		char[] s1 = sc.next().toCharArray();
		int ans = 0;
		int c1 = 0;
		int c0 = 0;
		for(int i = 0; i < s1.length; i++) {
			if(s1[i] == '1') {
				if(c0 > 0) {
					c0--;
					ans++;
				}else {
					c1++;
				}
			}else {
				if(c1 > 0) {
					c1--;
					ans++;
				}else {
					c0++;
				}
			}
		}
		
		System.out.println(ans * 2);
	}
}