import java.util.*;

public class Main {

    Scanner sc = new Scanner(System.in);

    public static void main(String[] args) {
        new Main().run();
    }

    void run() {

        char[] arr = sc.next().toCharArray();

        int cnt1 = 0;
        int cnt0 = 0;

        for (int i=0; i<arr.length; i++) {
            if (arr[i]=='1') cnt1++;
            if (arr[i]=='0') cnt0++;
        }

        int ans = arr.length;

        int diff = Math.abs(cnt0-cnt1);

        System.out.println(ans-diff);
    }

} import java.util.*; util.* java public class Main {

    Scanner sc = new Scanner(System.in);

    public static void main(String[] args) {
        new Main().run();
    }

    void run() {

        char[] arr = sc.next().toCharArray();

        int cnt1 = 0;
        int cnt0 = 0;

        for (int i=0; i<arr.length; i++) {
            if (arr[i]=='1') cnt1++;
            if (arr[i]=='0') cnt0++;
        }

        int ans = arr.length;

        int diff = Math.abs(cnt0-cnt1);

        System.out.println(ans-diff);
    }

} Main Scanner sc = new Scanner(System.in); sc new Scanner(System.in) public static void main(String[] args) {
        new Main().run();
    } main {
        new Main().run();
    } new Main().run() new Main().run new Main() String[] args args void run() {

        char[] arr = sc.next().toCharArray();

        int cnt1 = 0;
        int cnt0 = 0;

        for (int i=0; i<arr.length; i++) {
            if (arr[i]=='1') cnt1++;
            if (arr[i]=='0') cnt0++;
        }

        int ans = arr.length;

        int diff = Math.abs(cnt0-cnt1);

        System.out.println(ans-diff);
    } run {

        char[] arr = sc.next().toCharArray();

        int cnt1 = 0;
        int cnt0 = 0;

        for (int i=0; i<arr.length; i++) {
            if (arr[i]=='1') cnt1++;
            if (arr[i]=='0') cnt0++;
        }

        int ans = arr.length;

        int diff = Math.abs(cnt0-cnt1);

        System.out.println(ans-diff);
    } char[] arr = sc.next().toCharArray(); arr sc.next().toCharArray() sc.next().toCharArray sc.next() sc.next sc int cnt1 = 0; cnt1 0 int cnt0 = 0; cnt0 0 for (int i=0; i<arr.length; i++) {
            if (arr[i]=='1') cnt1++;
            if (arr[i]=='0') cnt0++;
        } int i=0; int i=0; i 0 i<arr.length i arr.length arr arr.length i++ i++ i {
            if (arr[i]=='1') cnt1++;
            if (arr[i]=='0') cnt0++;
        } {
            if (arr[i]=='1') cnt1++;
            if (arr[i]=='0') cnt0++;
        } if (arr[i]=='1') cnt1++; arr[i]=='1' arr[i] arr i '1' cnt1++ cnt1 if (arr[i]=='0') cnt0++; arr[i]=='0' arr[i] arr i '0' cnt0++ cnt0 int ans = arr.length; ans arr.length arr arr.length int diff = Math.abs(cnt0-cnt1); diff Math.abs(cnt0-cnt1) Math.abs Math cnt0-cnt1 cnt0 cnt1 System.out.println(ans-diff) System.out.println System.out System System.out ans-diff ans diff public class Main {

    Scanner sc = new Scanner(System.in);

    public static void main(String[] args) {
        new Main().run();
    }

    void run() {

        char[] arr = sc.next().toCharArray();

        int cnt1 = 0;
        int cnt0 = 0;

        for (int i=0; i<arr.length; i++) {
            if (arr[i]=='1') cnt1++;
            if (arr[i]=='0') cnt0++;
        }

        int ans = arr.length;

        int diff = Math.abs(cnt0-cnt1);

        System.out.println(ans-diff);
    }

} public class Main {

    Scanner sc = new Scanner(System.in);

    public static void main(String[] args) {
        new Main().run();
    }

    void run() {

        char[] arr = sc.next().toCharArray();

        int cnt1 = 0;
        int cnt0 = 0;

        for (int i=0; i<arr.length; i++) {
            if (arr[i]=='1') cnt1++;
            if (arr[i]=='0') cnt0++;
        }

        int ans = arr.length;

        int diff = Math.abs(cnt0-cnt1);

        System.out.println(ans-diff);
    }

} Main
import java.util.*;

public class Main {

    Scanner sc = new Scanner(System.in);

    public static void main(String[] args) {
        new Main().run();
    }

    void run() {

        char[] arr = sc.next().toCharArray();

        int cnt1 = 0;
        int cnt0 = 0;

        for (int i=0; i<arr.length; i++) {
            if (arr[i]=='1') cnt1++;
            if (arr[i]=='0') cnt0++;
        }

        int ans = arr.length;

        int diff = Math.abs(cnt0-cnt1);

        System.out.println(ans-diff);
    }

}
