import java.util.Scanner;

public class Main {
    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        int initLen = S.length();

        int zero = S.replace("1", "").length();
        int one = S.replace("0","").length();
        System.out.println(S.length() -  Math.abs(zero - one));

    }

} 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();
        int initLen = S.length();

        int zero = S.replace("1", "").length();
        int one = S.replace("0","").length();
        System.out.println(S.length() -  Math.abs(zero - one));

    }

} Main public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        int initLen = S.length();

        int zero = S.replace("1", "").length();
        int one = S.replace("0","").length();
        System.out.println(S.length() -  Math.abs(zero - one));

    } main {

        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        int initLen = S.length();

        int zero = S.replace("1", "").length();
        int one = S.replace("0","").length();
        System.out.println(S.length() -  Math.abs(zero - one));

    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String S = sc.next(); S sc.next() sc.next sc int initLen = S.length(); initLen S.length() S.length S int zero = S.replace("1", "").length(); zero S.replace("1", "").length() S.replace("1", "").length S.replace("1", "") S.replace S "1" "" int one = S.replace("0","").length(); one S.replace("0","").length() S.replace("0","").length S.replace("0","") S.replace S "0" "" System.out.println(S.length() -  Math.abs(zero - one)) System.out.println System.out System System.out S.length() -  Math.abs(zero - one) S.length() S.length S Math.abs(zero - one) Math.abs Math zero - one zero one String[] args args public class Main {
    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        int initLen = S.length();

        int zero = S.replace("1", "").length();
        int one = S.replace("0","").length();
        System.out.println(S.length() -  Math.abs(zero - one));

    }

} public class Main {
    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        int initLen = S.length();

        int zero = S.replace("1", "").length();
        int one = S.replace("0","").length();
        System.out.println(S.length() -  Math.abs(zero - one));

    }

} Main
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        int initLen = S.length();

        int zero = S.replace("1", "").length();
        int one = S.replace("0","").length();
        System.out.println(S.length() -  Math.abs(zero - one));

    }

}
