import java.util.HashMap;
import java.util.Scanner;

public class Main {


 	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		String cube[] = new String[S.length()];

		for (int i = 0; i < S.length(); i++) {
			cube[i] = S.substring(i, i+1);
		}

		HashMap<String, Integer> map = new HashMap<>();
		for (int i = 0; i < S.length(); i++) {
			if (!map.containsKey(cube[i])) {
				map.put(cube[i], 1);
			} else {
				int cnt = map.get(cube[i]);
				map.put(cube[i], cnt+1);
			}
		}

		if (!map.containsKey("0") || !map.containsKey("1")) {
			System.out.println(0);
			return;
		}

		int cnt0 = map.get("0");
		int cnt1 = map.get("1");

		System.out.println(Math.min(cnt0, cnt1)*2);
 	}
} import java.util.HashMap; HashMap java.util 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();
		String cube[] = new String[S.length()];

		for (int i = 0; i < S.length(); i++) {
			cube[i] = S.substring(i, i+1);
		}

		HashMap<String, Integer> map = new HashMap<>();
		for (int i = 0; i < S.length(); i++) {
			if (!map.containsKey(cube[i])) {
				map.put(cube[i], 1);
			} else {
				int cnt = map.get(cube[i]);
				map.put(cube[i], cnt+1);
			}
		}

		if (!map.containsKey("0") || !map.containsKey("1")) {
			System.out.println(0);
			return;
		}

		int cnt0 = map.get("0");
		int cnt1 = map.get("1");

		System.out.println(Math.min(cnt0, cnt1)*2);
 	}
} Main public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		String cube[] = new String[S.length()];

		for (int i = 0; i < S.length(); i++) {
			cube[i] = S.substring(i, i+1);
		}

		HashMap<String, Integer> map = new HashMap<>();
		for (int i = 0; i < S.length(); i++) {
			if (!map.containsKey(cube[i])) {
				map.put(cube[i], 1);
			} else {
				int cnt = map.get(cube[i]);
				map.put(cube[i], cnt+1);
			}
		}

		if (!map.containsKey("0") || !map.containsKey("1")) {
			System.out.println(0);
			return;
		}

		int cnt0 = map.get("0");
		int cnt1 = map.get("1");

		System.out.println(Math.min(cnt0, cnt1)*2);
 	} main {
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		String cube[] = new String[S.length()];

		for (int i = 0; i < S.length(); i++) {
			cube[i] = S.substring(i, i+1);
		}

		HashMap<String, Integer> map = new HashMap<>();
		for (int i = 0; i < S.length(); i++) {
			if (!map.containsKey(cube[i])) {
				map.put(cube[i], 1);
			} else {
				int cnt = map.get(cube[i]);
				map.put(cube[i], cnt+1);
			}
		}

		if (!map.containsKey("0") || !map.containsKey("1")) {
			System.out.println(0);
			return;
		}

		int cnt0 = map.get("0");
		int cnt1 = map.get("1");

		System.out.println(Math.min(cnt0, cnt1)*2);
 	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String S = sc.next(); S sc.next() sc.next sc String cube[] = new String[S.length()]; cube new String[S.length()] S.length() S.length S for (int i = 0; i < S.length(); i++) {
			cube[i] = S.substring(i, i+1);
		} int i = 0; int i = 0; i 0 i < S.length() i S.length() S.length S i++ i++ i {
			cube[i] = S.substring(i, i+1);
		} {
			cube[i] = S.substring(i, i+1);
		} cube[i] = S.substring(i, i+1) cube[i] cube i S.substring(i, i+1) S.substring S i i+1 i 1 HashMap<String, Integer> map = new HashMap<>(); map new HashMap<>() for (int i = 0; i < S.length(); i++) {
			if (!map.containsKey(cube[i])) {
				map.put(cube[i], 1);
			} else {
				int cnt = map.get(cube[i]);
				map.put(cube[i], cnt+1);
			}
		} int i = 0; int i = 0; i 0 i < S.length() i S.length() S.length S i++ i++ i {
			if (!map.containsKey(cube[i])) {
				map.put(cube[i], 1);
			} else {
				int cnt = map.get(cube[i]);
				map.put(cube[i], cnt+1);
			}
		} {
			if (!map.containsKey(cube[i])) {
				map.put(cube[i], 1);
			} else {
				int cnt = map.get(cube[i]);
				map.put(cube[i], cnt+1);
			}
		} if (!map.containsKey(cube[i])) {
				map.put(cube[i], 1);
			} else {
				int cnt = map.get(cube[i]);
				map.put(cube[i], cnt+1);
			} !map.containsKey(cube[i]) map.containsKey(cube[i]) map.containsKey map cube[i] cube i {
				map.put(cube[i], 1);
			} map.put(cube[i], 1) map.put map cube[i] cube i 1 {
				int cnt = map.get(cube[i]);
				map.put(cube[i], cnt+1);
			} int cnt = map.get(cube[i]); cnt map.get(cube[i]) map.get map cube[i] cube i map.put(cube[i], cnt+1) map.put map cube[i] cube i cnt+1 cnt 1 if (!map.containsKey("0") || !map.containsKey("1")) {
			System.out.println(0);
			return;
		} !map.containsKey("0") || !map.containsKey("1") !map.containsKey("0") map.containsKey("0") map.containsKey map "0" !map.containsKey("1") map.containsKey("1") map.containsKey map "1" {
			System.out.println(0);
			return;
		} System.out.println(0) System.out.println System.out System System.out 0 return; int cnt0 = map.get("0"); cnt0 map.get("0") map.get map "0" int cnt1 = map.get("1"); cnt1 map.get("1") map.get map "1" System.out.println(Math.min(cnt0, cnt1)*2) System.out.println System.out System System.out Math.min(cnt0, cnt1)*2 Math.min(cnt0, cnt1) Math.min Math cnt0 cnt1 2 String[] args args public class Main {


 	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		String cube[] = new String[S.length()];

		for (int i = 0; i < S.length(); i++) {
			cube[i] = S.substring(i, i+1);
		}

		HashMap<String, Integer> map = new HashMap<>();
		for (int i = 0; i < S.length(); i++) {
			if (!map.containsKey(cube[i])) {
				map.put(cube[i], 1);
			} else {
				int cnt = map.get(cube[i]);
				map.put(cube[i], cnt+1);
			}
		}

		if (!map.containsKey("0") || !map.containsKey("1")) {
			System.out.println(0);
			return;
		}

		int cnt0 = map.get("0");
		int cnt1 = map.get("1");

		System.out.println(Math.min(cnt0, cnt1)*2);
 	}
} public class Main {


 	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		String cube[] = new String[S.length()];

		for (int i = 0; i < S.length(); i++) {
			cube[i] = S.substring(i, i+1);
		}

		HashMap<String, Integer> map = new HashMap<>();
		for (int i = 0; i < S.length(); i++) {
			if (!map.containsKey(cube[i])) {
				map.put(cube[i], 1);
			} else {
				int cnt = map.get(cube[i]);
				map.put(cube[i], cnt+1);
			}
		}

		if (!map.containsKey("0") || !map.containsKey("1")) {
			System.out.println(0);
			return;
		}

		int cnt0 = map.get("0");
		int cnt1 = map.get("1");

		System.out.println(Math.min(cnt0, cnt1)*2);
 	}
} Main
import java.util.HashMap;
import java.util.Scanner;

public class Main {


 	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		String cube[] = new String[S.length()];

		for (int i = 0; i < S.length(); i++) {
			cube[i] = S.substring(i, i+1);
		}

		HashMap<String, Integer> map = new HashMap<>();
		for (int i = 0; i < S.length(); i++) {
			if (!map.containsKey(cube[i])) {
				map.put(cube[i], 1);
			} else {
				int cnt = map.get(cube[i]);
				map.put(cube[i], cnt+1);
			}
		}

		if (!map.containsKey("0") || !map.containsKey("1")) {
			System.out.println(0);
			return;
		}

		int cnt0 = map.get("0");
		int cnt1 = map.get("1");

		System.out.println(Math.min(cnt0, cnt1)*2);
 	}
}
