
import java.util.Scanner;

public class Main {

	/**
	 * 
	 * @param args
	 */
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		String S = scan.next();
		scan.close();
		
		//11011010001011
		//1 8
		//0 6

		//System.out.println(count(S)*2);
		int c0=0;
		int c1=0;
		for(int i=0; i<S.length(); i++) {
			if(S.charAt(i)=='0') {
				c0++;
			} else {
				c1++;
			}
		}
		System.out.println(S.length()-(Math.abs(c0-c1)));

		
		
	}
	public static int count(String S) {
		int c=0;
		String T="";

		for(int i=0; i<S.length()-1; i++) {
			if(S.charAt(i+1) != S.charAt(i)) {
				c++;
				i++;
				if(i==S.length()-2) {
					T=T+S.charAt(i+1);
				}
			} else {
				T=T+S.charAt(i+1);
				if(i+1==S.length()) {
					T=T+S.charAt(i);
				}
			}
		}
		if(c==0) {
			return 0;
		}
		c+=count(T);
		return c;
		
	}

} import java.util.Scanner; Scanner java.util public class Main {

	/**
	 * 
	 * @param args
	 */
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		String S = scan.next();
		scan.close();
		
		//11011010001011
		//1 8
		//0 6

		//System.out.println(count(S)*2);
		int c0=0;
		int c1=0;
		for(int i=0; i<S.length(); i++) {
			if(S.charAt(i)=='0') {
				c0++;
			} else {
				c1++;
			}
		}
		System.out.println(S.length()-(Math.abs(c0-c1)));

		
		
	}
	public static int count(String S) {
		int c=0;
		String T="";

		for(int i=0; i<S.length()-1; i++) {
			if(S.charAt(i+1) != S.charAt(i)) {
				c++;
				i++;
				if(i==S.length()-2) {
					T=T+S.charAt(i+1);
				}
			} else {
				T=T+S.charAt(i+1);
				if(i+1==S.length()) {
					T=T+S.charAt(i);
				}
			}
		}
		if(c==0) {
			return 0;
		}
		c+=count(T);
		return c;
		
	}

} Main /**
	 * 
	 * @param args
	 */
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		String S = scan.next();
		scan.close();
		
		//11011010001011
		//1 8
		//0 6

		//System.out.println(count(S)*2);
		int c0=0;
		int c1=0;
		for(int i=0; i<S.length(); i++) {
			if(S.charAt(i)=='0') {
				c0++;
			} else {
				c1++;
			}
		}
		System.out.println(S.length()-(Math.abs(c0-c1)));

		
		
	} main {
		Scanner scan = new Scanner(System.in);
		String S = scan.next();
		scan.close();
		
		//11011010001011
		//1 8
		//0 6

		//System.out.println(count(S)*2);
		int c0=0;
		int c1=0;
		for(int i=0; i<S.length(); i++) {
			if(S.charAt(i)=='0') {
				c0++;
			} else {
				c1++;
			}
		}
		System.out.println(S.length()-(Math.abs(c0-c1)));

		
		
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) String S = scan.next(); S scan.next() scan.next scan scan.close() scan.close scan int c0=0; c0 0 int c1=0; c1 0 for(int i=0; i<S.length(); i++) {
			if(S.charAt(i)=='0') {
				c0++;
			} else {
				c1++;
			}
		} 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') {
				c0++;
			} else {
				c1++;
			}
		} {
			if(S.charAt(i)=='0') {
				c0++;
			} else {
				c1++;
			}
		} if(S.charAt(i)=='0') {
				c0++;
			} else {
				c1++;
			} S.charAt(i)=='0' S.charAt(i) S.charAt S i '0' {
				c0++;
			} c0++ c0 {
				c1++;
			} c1++ c1 System.out.println(S.length()-(Math.abs(c0-c1))) System.out.println System.out System System.out S.length()-(Math.abs(c0-c1)) S.length() S.length S (Math.abs(c0-c1)) Math.abs Math c0-c1 c0 c1 String[] args args public static int count(String S) {
		int c=0;
		String T="";

		for(int i=0; i<S.length()-1; i++) {
			if(S.charAt(i+1) != S.charAt(i)) {
				c++;
				i++;
				if(i==S.length()-2) {
					T=T+S.charAt(i+1);
				}
			} else {
				T=T+S.charAt(i+1);
				if(i+1==S.length()) {
					T=T+S.charAt(i);
				}
			}
		}
		if(c==0) {
			return 0;
		}
		c+=count(T);
		return c;
		
	} count {
		int c=0;
		String T="";

		for(int i=0; i<S.length()-1; i++) {
			if(S.charAt(i+1) != S.charAt(i)) {
				c++;
				i++;
				if(i==S.length()-2) {
					T=T+S.charAt(i+1);
				}
			} else {
				T=T+S.charAt(i+1);
				if(i+1==S.length()) {
					T=T+S.charAt(i);
				}
			}
		}
		if(c==0) {
			return 0;
		}
		c+=count(T);
		return c;
		
	} int c=0; c 0 String T=""; T "" for(int i=0; i<S.length()-1; i++) {
			if(S.charAt(i+1) != S.charAt(i)) {
				c++;
				i++;
				if(i==S.length()-2) {
					T=T+S.charAt(i+1);
				}
			} else {
				T=T+S.charAt(i+1);
				if(i+1==S.length()) {
					T=T+S.charAt(i);
				}
			}
		} int i=0; int i=0; i 0 i<S.length()-1 i S.length()-1 S.length() S.length S 1 i++ i++ i {
			if(S.charAt(i+1) != S.charAt(i)) {
				c++;
				i++;
				if(i==S.length()-2) {
					T=T+S.charAt(i+1);
				}
			} else {
				T=T+S.charAt(i+1);
				if(i+1==S.length()) {
					T=T+S.charAt(i);
				}
			}
		} {
			if(S.charAt(i+1) != S.charAt(i)) {
				c++;
				i++;
				if(i==S.length()-2) {
					T=T+S.charAt(i+1);
				}
			} else {
				T=T+S.charAt(i+1);
				if(i+1==S.length()) {
					T=T+S.charAt(i);
				}
			}
		} if(S.charAt(i+1) != S.charAt(i)) {
				c++;
				i++;
				if(i==S.length()-2) {
					T=T+S.charAt(i+1);
				}
			} else {
				T=T+S.charAt(i+1);
				if(i+1==S.length()) {
					T=T+S.charAt(i);
				}
			} S.charAt(i+1) != S.charAt(i) S.charAt(i+1) S.charAt S i+1 i 1 S.charAt(i) S.charAt S i {
				c++;
				i++;
				if(i==S.length()-2) {
					T=T+S.charAt(i+1);
				}
			} c++ c i++ i if(i==S.length()-2) {
					T=T+S.charAt(i+1);
				} i==S.length()-2 i S.length()-2 S.length() S.length S 2 {
					T=T+S.charAt(i+1);
				} T=T+S.charAt(i+1) T T+S.charAt(i+1) T S.charAt(i+1) S.charAt S i+1 i 1 {
				T=T+S.charAt(i+1);
				if(i+1==S.length()) {
					T=T+S.charAt(i);
				}
			} T=T+S.charAt(i+1) T T+S.charAt(i+1) T S.charAt(i+1) S.charAt S i+1 i 1 if(i+1==S.length()) {
					T=T+S.charAt(i);
				} i+1==S.length() i+1 i 1 S.length() S.length S {
					T=T+S.charAt(i);
				} T=T+S.charAt(i) T T+S.charAt(i) T S.charAt(i) S.charAt S i if(c==0) {
			return 0;
		} c==0 c 0 {
			return 0;
		} return 0; 0 c+=count(T) c count(T) count T return c; c String S S public class Main {

	/**
	 * 
	 * @param args
	 */
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		String S = scan.next();
		scan.close();
		
		//11011010001011
		//1 8
		//0 6

		//System.out.println(count(S)*2);
		int c0=0;
		int c1=0;
		for(int i=0; i<S.length(); i++) {
			if(S.charAt(i)=='0') {
				c0++;
			} else {
				c1++;
			}
		}
		System.out.println(S.length()-(Math.abs(c0-c1)));

		
		
	}
	public static int count(String S) {
		int c=0;
		String T="";

		for(int i=0; i<S.length()-1; i++) {
			if(S.charAt(i+1) != S.charAt(i)) {
				c++;
				i++;
				if(i==S.length()-2) {
					T=T+S.charAt(i+1);
				}
			} else {
				T=T+S.charAt(i+1);
				if(i+1==S.length()) {
					T=T+S.charAt(i);
				}
			}
		}
		if(c==0) {
			return 0;
		}
		c+=count(T);
		return c;
		
	}

} public class Main {

	/**
	 * 
	 * @param args
	 */
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		String S = scan.next();
		scan.close();
		
		//11011010001011
		//1 8
		//0 6

		//System.out.println(count(S)*2);
		int c0=0;
		int c1=0;
		for(int i=0; i<S.length(); i++) {
			if(S.charAt(i)=='0') {
				c0++;
			} else {
				c1++;
			}
		}
		System.out.println(S.length()-(Math.abs(c0-c1)));

		
		
	}
	public static int count(String S) {
		int c=0;
		String T="";

		for(int i=0; i<S.length()-1; i++) {
			if(S.charAt(i+1) != S.charAt(i)) {
				c++;
				i++;
				if(i==S.length()-2) {
					T=T+S.charAt(i+1);
				}
			} else {
				T=T+S.charAt(i+1);
				if(i+1==S.length()) {
					T=T+S.charAt(i);
				}
			}
		}
		if(c==0) {
			return 0;
		}
		c+=count(T);
		return c;
		
	}

} Main

import java.util.Scanner;

public class Main {

	/**
	 * 
	 * @param args
	 */
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		String S = scan.next();
		scan.close();
		
		//11011010001011
		//1 8
		//0 6

		//System.out.println(count(S)*2);
		int c0=0;
		int c1=0;
		for(int i=0; i<S.length(); i++) {
			if(S.charAt(i)=='0') {
				c0++;
			} else {
				c1++;
			}
		}
		System.out.println(S.length()-(Math.abs(c0-c1)));

		
		
	}
	public static int count(String S) {
		int c=0;
		String T="";

		for(int i=0; i<S.length()-1; i++) {
			if(S.charAt(i+1) != S.charAt(i)) {
				c++;
				i++;
				if(i==S.length()-2) {
					T=T+S.charAt(i+1);
				}
			} else {
				T=T+S.charAt(i+1);
				if(i+1==S.length()) {
					T=T+S.charAt(i);
				}
			}
		}
		if(c==0) {
			return 0;
		}
		c+=count(T);
		return c;
		
	}

}
