import java.util.Scanner;

public class Main {

	public static void main(String args[]) {

		Scanner sc = new Scanner(System.in);
		StringBuilder s = new StringBuilder().append(sc.nextLine());

		int ans = 0;
		int i = 0;
		while(i<s.length()-1) {
			if(s.substring(i, i+2).equals("01") ||
			   s.substring(i, i+2).equals("10")) {
				s = s.delete(i, i+2);
				ans += 2;
				if(i > 0) i--;
			}else {
				i++;
			}
		}
		System.out.println(ans);
	}
} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String args[]) {

		Scanner sc = new Scanner(System.in);
		StringBuilder s = new StringBuilder().append(sc.nextLine());

		int ans = 0;
		int i = 0;
		while(i<s.length()-1) {
			if(s.substring(i, i+2).equals("01") ||
			   s.substring(i, i+2).equals("10")) {
				s = s.delete(i, i+2);
				ans += 2;
				if(i > 0) i--;
			}else {
				i++;
			}
		}
		System.out.println(ans);
	}
} Main public static void main(String args[]) {

		Scanner sc = new Scanner(System.in);
		StringBuilder s = new StringBuilder().append(sc.nextLine());

		int ans = 0;
		int i = 0;
		while(i<s.length()-1) {
			if(s.substring(i, i+2).equals("01") ||
			   s.substring(i, i+2).equals("10")) {
				s = s.delete(i, i+2);
				ans += 2;
				if(i > 0) i--;
			}else {
				i++;
			}
		}
		System.out.println(ans);
	} main {

		Scanner sc = new Scanner(System.in);
		StringBuilder s = new StringBuilder().append(sc.nextLine());

		int ans = 0;
		int i = 0;
		while(i<s.length()-1) {
			if(s.substring(i, i+2).equals("01") ||
			   s.substring(i, i+2).equals("10")) {
				s = s.delete(i, i+2);
				ans += 2;
				if(i > 0) i--;
			}else {
				i++;
			}
		}
		System.out.println(ans);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) StringBuilder s = new StringBuilder().append(sc.nextLine()); s new StringBuilder().append(sc.nextLine()) new StringBuilder().append new StringBuilder() sc.nextLine() sc.nextLine sc int ans = 0; ans 0 int i = 0; i 0 while(i<s.length()-1) {
			if(s.substring(i, i+2).equals("01") ||
			   s.substring(i, i+2).equals("10")) {
				s = s.delete(i, i+2);
				ans += 2;
				if(i > 0) i--;
			}else {
				i++;
			}
		} i<s.length()-1 i s.length()-1 s.length() s.length s 1 {
			if(s.substring(i, i+2).equals("01") ||
			   s.substring(i, i+2).equals("10")) {
				s = s.delete(i, i+2);
				ans += 2;
				if(i > 0) i--;
			}else {
				i++;
			}
		} if(s.substring(i, i+2).equals("01") ||
			   s.substring(i, i+2).equals("10")) {
				s = s.delete(i, i+2);
				ans += 2;
				if(i > 0) i--;
			}else {
				i++;
			} s.substring(i, i+2).equals("01") ||
			   s.substring(i, i+2).equals("10") s.substring(i, i+2).equals("01") s.substring(i, i+2).equals s.substring(i, i+2) s.substring s i i+2 i 2 "01" s.substring(i, i+2).equals("10") s.substring(i, i+2).equals s.substring(i, i+2) s.substring s i i+2 i 2 "10" {
				s = s.delete(i, i+2);
				ans += 2;
				if(i > 0) i--;
			} s = s.delete(i, i+2) s s.delete(i, i+2) s.delete s i i+2 i 2 ans += 2 ans 2 if(i > 0) i--; i > 0 i 0 i-- i {
				i++;
			} i++ i System.out.println(ans) System.out.println System.out System System.out ans String args[] args public class Main {

	public static void main(String args[]) {

		Scanner sc = new Scanner(System.in);
		StringBuilder s = new StringBuilder().append(sc.nextLine());

		int ans = 0;
		int i = 0;
		while(i<s.length()-1) {
			if(s.substring(i, i+2).equals("01") ||
			   s.substring(i, i+2).equals("10")) {
				s = s.delete(i, i+2);
				ans += 2;
				if(i > 0) i--;
			}else {
				i++;
			}
		}
		System.out.println(ans);
	}
} public class Main {

	public static void main(String args[]) {

		Scanner sc = new Scanner(System.in);
		StringBuilder s = new StringBuilder().append(sc.nextLine());

		int ans = 0;
		int i = 0;
		while(i<s.length()-1) {
			if(s.substring(i, i+2).equals("01") ||
			   s.substring(i, i+2).equals("10")) {
				s = s.delete(i, i+2);
				ans += 2;
				if(i > 0) i--;
			}else {
				i++;
			}
		}
		System.out.println(ans);
	}
} Main
import java.util.Scanner;

public class Main {

	public static void main(String args[]) {

		Scanner sc = new Scanner(System.in);
		StringBuilder s = new StringBuilder().append(sc.nextLine());

		int ans = 0;
		int i = 0;
		while(i<s.length()-1) {
			if(s.substring(i, i+2).equals("01") ||
			   s.substring(i, i+2).equals("10")) {
				s = s.delete(i, i+2);
				ans += 2;
				if(i > 0) i--;
			}else {
				i++;
			}
		}
		System.out.println(ans);
	}
}