import java.util.Scanner;

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

int an,mi;

if((n0-n1)>0){
	mi=n0-n1;
}else{
	mi=n0-n1;
	mi=0-mi;
}
an=s.length()-mi;
System.out.println(an);
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n1 = 0;
		int n0 = 0;
		String s = sc.next();
		char a[] = new char[s.length() + 1];
		for (int i = 0; i <= s.length() - 1; i++) {
			a[i + 1] = s.charAt(i);
			if (a[i + 1] == '1') {
				n1++;
			}
		}
n0=s.length()-n1;

int an,mi;

if((n0-n1)>0){
	mi=n0-n1;
}else{
	mi=n0-n1;
	mi=0-mi;
}
an=s.length()-mi;
System.out.println(an);
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n1 = 0;
		int n0 = 0;
		String s = sc.next();
		char a[] = new char[s.length() + 1];
		for (int i = 0; i <= s.length() - 1; i++) {
			a[i + 1] = s.charAt(i);
			if (a[i + 1] == '1') {
				n1++;
			}
		}
n0=s.length()-n1;

int an,mi;

if((n0-n1)>0){
	mi=n0-n1;
}else{
	mi=n0-n1;
	mi=0-mi;
}
an=s.length()-mi;
System.out.println(an);
	} main {
		Scanner sc = new Scanner(System.in);
		int n1 = 0;
		int n0 = 0;
		String s = sc.next();
		char a[] = new char[s.length() + 1];
		for (int i = 0; i <= s.length() - 1; i++) {
			a[i + 1] = s.charAt(i);
			if (a[i + 1] == '1') {
				n1++;
			}
		}
n0=s.length()-n1;

int an,mi;

if((n0-n1)>0){
	mi=n0-n1;
}else{
	mi=n0-n1;
	mi=0-mi;
}
an=s.length()-mi;
System.out.println(an);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n1 = 0; n1 0 int n0 = 0; n0 0 String s = sc.next(); s sc.next() sc.next sc char a[] = new char[s.length() + 1]; a new char[s.length() + 1] s.length() + 1 s.length() s.length s 1 for (int i = 0; i <= s.length() - 1; i++) {
			a[i + 1] = s.charAt(i);
			if (a[i + 1] == '1') {
				n1++;
			}
		} 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 {
			a[i + 1] = s.charAt(i);
			if (a[i + 1] == '1') {
				n1++;
			}
		} {
			a[i + 1] = s.charAt(i);
			if (a[i + 1] == '1') {
				n1++;
			}
		} a[i + 1] = s.charAt(i) a[i + 1] a i + 1 i 1 s.charAt(i) s.charAt s i if (a[i + 1] == '1') {
				n1++;
			} a[i + 1] == '1' a[i + 1] a i + 1 i 1 '1' {
				n1++;
			} n1++ n1 n0=s.length()-n1 n0 s.length()-n1 s.length() s.length s n1 int an an mi; mi if((n0-n1)>0){
	mi=n0-n1;
}else{
	mi=n0-n1;
	mi=0-mi;
} (n0-n1)>0 (n0-n1) n0 n1 0 {
	mi=n0-n1;
} mi=n0-n1 mi n0-n1 n0 n1 {
	mi=n0-n1;
	mi=0-mi;
} mi=n0-n1 mi n0-n1 n0 n1 mi=0-mi mi 0-mi 0 mi an=s.length()-mi an s.length()-mi s.length() s.length s mi System.out.println(an) System.out.println System.out System System.out an String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n1 = 0;
		int n0 = 0;
		String s = sc.next();
		char a[] = new char[s.length() + 1];
		for (int i = 0; i <= s.length() - 1; i++) {
			a[i + 1] = s.charAt(i);
			if (a[i + 1] == '1') {
				n1++;
			}
		}
n0=s.length()-n1;

int an,mi;

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

int an,mi;

if((n0-n1)>0){
	mi=n0-n1;
}else{
	mi=n0-n1;
	mi=0-mi;
}
an=s.length()-mi;
System.out.println(an);
	}
} Main
import java.util.Scanner;

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

int an,mi;

if((n0-n1)>0){
	mi=n0-n1;
}else{
	mi=n0-n1;
	mi=0-mi;
}
an=s.length()-mi;
System.out.println(an);
	}
}