import java.util.Scanner;

public class Main {

    public static void main(String args[]) {

        // 入力
        Scanner sc = new Scanner(System.in);
        String s = sc.next();

        // 主処理
        int count0 = 0;
        int count1 = 0;
        String[] arr = s.split("");
        for (int i = 0; i < s.length(); i++) {
            if ("0".equals(arr[i])) {
                count0++;
            } else {
                count1++;
            }
        }
        int result = s.length() - Math.abs(count0 - count1);

        // 出力
        System.out.println(result);
        sc.close();
    }
} 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 count0 = 0;
        int count1 = 0;
        String[] arr = s.split("");
        for (int i = 0; i < s.length(); i++) {
            if ("0".equals(arr[i])) {
                count0++;
            } else {
                count1++;
            }
        }
        int result = s.length() - Math.abs(count0 - count1);

        // 出力
        System.out.println(result);
        sc.close();
    }
} Main public static void main(String args[]) {

        // 入力
        Scanner sc = new Scanner(System.in);
        String s = sc.next();

        // 主処理
        int count0 = 0;
        int count1 = 0;
        String[] arr = s.split("");
        for (int i = 0; i < s.length(); i++) {
            if ("0".equals(arr[i])) {
                count0++;
            } else {
                count1++;
            }
        }
        int result = s.length() - Math.abs(count0 - count1);

        // 出力
        System.out.println(result);
        sc.close();
    } main {

        // 入力
        Scanner sc = new Scanner(System.in);
        String s = sc.next();

        // 主処理
        int count0 = 0;
        int count1 = 0;
        String[] arr = s.split("");
        for (int i = 0; i < s.length(); i++) {
            if ("0".equals(arr[i])) {
                count0++;
            } else {
                count1++;
            }
        }
        int result = s.length() - Math.abs(count0 - count1);

        // 出力
        System.out.println(result);
        sc.close();
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String s = sc.next(); s sc.next() sc.next sc int count0 = 0; count0 0 int count1 = 0; count1 0 String[] arr = s.split(""); arr s.split("") s.split s "" for (int i = 0; i < s.length(); i++) {
            if ("0".equals(arr[i])) {
                count0++;
            } else {
                count1++;
            }
        } int i = 0; int i = 0; i 0 i < s.length() i s.length() s.length s i++ i++ i {
            if ("0".equals(arr[i])) {
                count0++;
            } else {
                count1++;
            }
        } {
            if ("0".equals(arr[i])) {
                count0++;
            } else {
                count1++;
            }
        } if ("0".equals(arr[i])) {
                count0++;
            } else {
                count1++;
            } "0".equals(arr[i]) "0".equals "0" arr[i] arr i {
                count0++;
            } count0++ count0 {
                count1++;
            } count1++ count1 int result = s.length() - Math.abs(count0 - count1); result s.length() - Math.abs(count0 - count1) s.length() s.length s Math.abs(count0 - count1) Math.abs Math count0 - count1 count0 count1 System.out.println(result) System.out.println System.out System System.out result sc.close() sc.close sc String args[] args public class Main {

    public static void main(String args[]) {

        // 入力
        Scanner sc = new Scanner(System.in);
        String s = sc.next();

        // 主処理
        int count0 = 0;
        int count1 = 0;
        String[] arr = s.split("");
        for (int i = 0; i < s.length(); i++) {
            if ("0".equals(arr[i])) {
                count0++;
            } else {
                count1++;
            }
        }
        int result = s.length() - Math.abs(count0 - count1);

        // 出力
        System.out.println(result);
        sc.close();
    }
} public class Main {

    public static void main(String args[]) {

        // 入力
        Scanner sc = new Scanner(System.in);
        String s = sc.next();

        // 主処理
        int count0 = 0;
        int count1 = 0;
        String[] arr = s.split("");
        for (int i = 0; i < s.length(); i++) {
            if ("0".equals(arr[i])) {
                count0++;
            } else {
                count1++;
            }
        }
        int result = s.length() - Math.abs(count0 - count1);

        // 出力
        System.out.println(result);
        sc.close();
    }
} 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 count0 = 0;
        int count1 = 0;
        String[] arr = s.split("");
        for (int i = 0; i < s.length(); i++) {
            if ("0".equals(arr[i])) {
                count0++;
            } else {
                count1++;
            }
        }
        int result = s.length() - Math.abs(count0 - count1);

        // 出力
        System.out.println(result);
        sc.close();
    }
}