import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        int n = s.length();
        int a = 0;
        int b = 0;
        for (int i=0;i<n;i++){
            if (s.charAt(i)=='0')a++;
            else b++;
        }
        System.out.println(n-Math.abs(a-b));
    }
} 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 n = s.length();
        int a = 0;
        int b = 0;
        for (int i=0;i<n;i++){
            if (s.charAt(i)=='0')a++;
            else b++;
        }
        System.out.println(n-Math.abs(a-b));
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        int n = s.length();
        int a = 0;
        int b = 0;
        for (int i=0;i<n;i++){
            if (s.charAt(i)=='0')a++;
            else b++;
        }
        System.out.println(n-Math.abs(a-b));
    } main {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        int n = s.length();
        int a = 0;
        int b = 0;
        for (int i=0;i<n;i++){
            if (s.charAt(i)=='0')a++;
            else b++;
        }
        System.out.println(n-Math.abs(a-b));
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String s = sc.next(); s sc.next() sc.next sc int n = s.length(); n s.length() s.length s int a = 0; a 0 int b = 0; b 0 for (int i=0;i<n;i++){
            if (s.charAt(i)=='0')a++;
            else b++;
        } int i=0; int i=0; i 0 i<n i n i++ i++ i {
            if (s.charAt(i)=='0')a++;
            else b++;
        } {
            if (s.charAt(i)=='0')a++;
            else b++;
        } if (s.charAt(i)=='0')a++;
            else b++; s.charAt(i)=='0' s.charAt(i) s.charAt s i '0' a++ a b++ b System.out.println(n-Math.abs(a-b)) System.out.println System.out System System.out n-Math.abs(a-b) n Math.abs(a-b) Math.abs Math a-b a b String[] args args public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        int n = s.length();
        int a = 0;
        int b = 0;
        for (int i=0;i<n;i++){
            if (s.charAt(i)=='0')a++;
            else b++;
        }
        System.out.println(n-Math.abs(a-b));
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        int n = s.length();
        int a = 0;
        int b = 0;
        for (int i=0;i<n;i++){
            if (s.charAt(i)=='0')a++;
            else b++;
        }
        System.out.println(n-Math.abs(a-b));
    }
} 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 n = s.length();
        int a = 0;
        int b = 0;
        for (int i=0;i<n;i++){
            if (s.charAt(i)=='0')a++;
            else b++;
        }
        System.out.println(n-Math.abs(a-b));
    }
}
