import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String word = sc.next();
        String[] words = word.split("");
        int num0 = 0;
        int num1 = 0;

        for (int n = 0; n < words.length; n++) {
            if (words[n].equals("0")) {
                num0 = num0 + 1;
            }
            else {
                num1 = num1 + 1;
            }
        }
         if (num1 > num0) {
            System.out.println(num0 * 2);
        } else if (num0 > num1) {
            System.out.println(num1 * 2);
        } else {
            System.out.println(num1 + num0);
        }
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String word = sc.next();
        String[] words = word.split("");
        int num0 = 0;
        int num1 = 0;

        for (int n = 0; n < words.length; n++) {
            if (words[n].equals("0")) {
                num0 = num0 + 1;
            }
            else {
                num1 = num1 + 1;
            }
        }
         if (num1 > num0) {
            System.out.println(num0 * 2);
        } else if (num0 > num1) {
            System.out.println(num1 * 2);
        } else {
            System.out.println(num1 + num0);
        }
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String word = sc.next();
        String[] words = word.split("");
        int num0 = 0;
        int num1 = 0;

        for (int n = 0; n < words.length; n++) {
            if (words[n].equals("0")) {
                num0 = num0 + 1;
            }
            else {
                num1 = num1 + 1;
            }
        }
         if (num1 > num0) {
            System.out.println(num0 * 2);
        } else if (num0 > num1) {
            System.out.println(num1 * 2);
        } else {
            System.out.println(num1 + num0);
        }
    } main {
        Scanner sc = new Scanner(System.in);
        String word = sc.next();
        String[] words = word.split("");
        int num0 = 0;
        int num1 = 0;

        for (int n = 0; n < words.length; n++) {
            if (words[n].equals("0")) {
                num0 = num0 + 1;
            }
            else {
                num1 = num1 + 1;
            }
        }
         if (num1 > num0) {
            System.out.println(num0 * 2);
        } else if (num0 > num1) {
            System.out.println(num1 * 2);
        } else {
            System.out.println(num1 + num0);
        }
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String word = sc.next(); word sc.next() sc.next sc String[] words = word.split(""); words word.split("") word.split word "" int num0 = 0; num0 0 int num1 = 0; num1 0 for (int n = 0; n < words.length; n++) {
            if (words[n].equals("0")) {
                num0 = num0 + 1;
            }
            else {
                num1 = num1 + 1;
            }
        } int n = 0; int n = 0; n 0 n < words.length n words.length words words.length n++ n++ n {
            if (words[n].equals("0")) {
                num0 = num0 + 1;
            }
            else {
                num1 = num1 + 1;
            }
        } {
            if (words[n].equals("0")) {
                num0 = num0 + 1;
            }
            else {
                num1 = num1 + 1;
            }
        } if (words[n].equals("0")) {
                num0 = num0 + 1;
            }
            else {
                num1 = num1 + 1;
            } words[n].equals("0") words[n].equals words[n] words n "0" {
                num0 = num0 + 1;
            } num0 = num0 + 1 num0 num0 + 1 num0 1 {
                num1 = num1 + 1;
            } num1 = num1 + 1 num1 num1 + 1 num1 1 if (num1 > num0) {
            System.out.println(num0 * 2);
        } else if (num0 > num1) {
            System.out.println(num1 * 2);
        } else {
            System.out.println(num1 + num0);
        } num1 > num0 num1 num0 {
            System.out.println(num0 * 2);
        } System.out.println(num0 * 2) System.out.println System.out System System.out num0 * 2 num0 2 if (num0 > num1) {
            System.out.println(num1 * 2);
        } else {
            System.out.println(num1 + num0);
        } num0 > num1 num0 num1 {
            System.out.println(num1 * 2);
        } System.out.println(num1 * 2) System.out.println System.out System System.out num1 * 2 num1 2 {
            System.out.println(num1 + num0);
        } System.out.println(num1 + num0) System.out.println System.out System System.out num1 + num0 num1 num0 String[] args args public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String word = sc.next();
        String[] words = word.split("");
        int num0 = 0;
        int num1 = 0;

        for (int n = 0; n < words.length; n++) {
            if (words[n].equals("0")) {
                num0 = num0 + 1;
            }
            else {
                num1 = num1 + 1;
            }
        }
         if (num1 > num0) {
            System.out.println(num0 * 2);
        } else if (num0 > num1) {
            System.out.println(num1 * 2);
        } else {
            System.out.println(num1 + num0);
        }
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String word = sc.next();
        String[] words = word.split("");
        int num0 = 0;
        int num1 = 0;

        for (int n = 0; n < words.length; n++) {
            if (words[n].equals("0")) {
                num0 = num0 + 1;
            }
            else {
                num1 = num1 + 1;
            }
        }
         if (num1 > num0) {
            System.out.println(num0 * 2);
        } else if (num0 > num1) {
            System.out.println(num1 * 2);
        } else {
            System.out.println(num1 + num0);
        }
    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String word = sc.next();
        String[] words = word.split("");
        int num0 = 0;
        int num1 = 0;

        for (int n = 0; n < words.length; n++) {
            if (words[n].equals("0")) {
                num0 = num0 + 1;
            }
            else {
                num1 = num1 + 1;
            }
        }
         if (num1 > num0) {
            System.out.println(num0 * 2);
        } else if (num0 > num1) {
            System.out.println(num1 * 2);
        } else {
            System.out.println(num1 + num0);
        }
    }
}