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();
        String n[] = new String[N];
        int ans = 0;
        int count0 = 0;
        int count1 = 0;
        
        for(int i = 0 ; i < N ; i++){
                n[i] = String.valueOf(S.charAt(i));
                if(n[i].equals("0")){
                    count0++;
                }else if(n[i].equals("1")){
                    count1++;
                }
        }      
        
        if(count0 == count1){
            ans = N;
        }else if(count0 > count1){
            ans = count1 * 2;
        }else{
            ans = count0 * 2;
        }
        
        System.out.print(ans);
        
    }
    
} 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();
        String n[] = new String[N];
        int ans = 0;
        int count0 = 0;
        int count1 = 0;
        
        for(int i = 0 ; i < N ; i++){
                n[i] = String.valueOf(S.charAt(i));
                if(n[i].equals("0")){
                    count0++;
                }else if(n[i].equals("1")){
                    count1++;
                }
        }      
        
        if(count0 == count1){
            ans = N;
        }else if(count0 > count1){
            ans = count1 * 2;
        }else{
            ans = count0 * 2;
        }
        
        System.out.print(ans);
        
    }
    
} Main public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        int N = S.length();
        String n[] = new String[N];
        int ans = 0;
        int count0 = 0;
        int count1 = 0;
        
        for(int i = 0 ; i < N ; i++){
                n[i] = String.valueOf(S.charAt(i));
                if(n[i].equals("0")){
                    count0++;
                }else if(n[i].equals("1")){
                    count1++;
                }
        }      
        
        if(count0 == count1){
            ans = N;
        }else if(count0 > count1){
            ans = count1 * 2;
        }else{
            ans = count0 * 2;
        }
        
        System.out.print(ans);
        
    } main {
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        int N = S.length();
        String n[] = new String[N];
        int ans = 0;
        int count0 = 0;
        int count1 = 0;
        
        for(int i = 0 ; i < N ; i++){
                n[i] = String.valueOf(S.charAt(i));
                if(n[i].equals("0")){
                    count0++;
                }else if(n[i].equals("1")){
                    count1++;
                }
        }      
        
        if(count0 == count1){
            ans = N;
        }else if(count0 > count1){
            ans = count1 * 2;
        }else{
            ans = count0 * 2;
        }
        
        System.out.print(ans);
        
    } 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 String n[] = new String[N]; n new String[N] N int ans = 0; ans 0 int count0 = 0; count0 0 int count1 = 0; count1 0 for(int i = 0 ; i < N ; i++){
                n[i] = String.valueOf(S.charAt(i));
                if(n[i].equals("0")){
                    count0++;
                }else if(n[i].equals("1")){
                    count1++;
                }
        } int i = 0 ; int i = 0 ; i 0 i < N i N i++ i++ i {
                n[i] = String.valueOf(S.charAt(i));
                if(n[i].equals("0")){
                    count0++;
                }else if(n[i].equals("1")){
                    count1++;
                }
        } {
                n[i] = String.valueOf(S.charAt(i));
                if(n[i].equals("0")){
                    count0++;
                }else if(n[i].equals("1")){
                    count1++;
                }
        } n[i] = String.valueOf(S.charAt(i)) n[i] n i String.valueOf(S.charAt(i)) String.valueOf String S.charAt(i) S.charAt S i if(n[i].equals("0")){
                    count0++;
                }else if(n[i].equals("1")){
                    count1++;
                } n[i].equals("0") n[i].equals n[i] n i "0" {
                    count0++;
                } count0++ count0 if(n[i].equals("1")){
                    count1++;
                } n[i].equals("1") n[i].equals n[i] n i "1" {
                    count1++;
                } count1++ count1 if(count0 == count1){
            ans = N;
        }else if(count0 > count1){
            ans = count1 * 2;
        }else{
            ans = count0 * 2;
        } count0 == count1 count0 count1 {
            ans = N;
        } ans = N ans N if(count0 > count1){
            ans = count1 * 2;
        }else{
            ans = count0 * 2;
        } count0 > count1 count0 count1 {
            ans = count1 * 2;
        } ans = count1 * 2 ans count1 * 2 count1 2 {
            ans = count0 * 2;
        } ans = count0 * 2 ans count0 * 2 count0 2 System.out.print(ans) System.out.print System.out System System.out ans 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();
        String n[] = new String[N];
        int ans = 0;
        int count0 = 0;
        int count1 = 0;
        
        for(int i = 0 ; i < N ; i++){
                n[i] = String.valueOf(S.charAt(i));
                if(n[i].equals("0")){
                    count0++;
                }else if(n[i].equals("1")){
                    count1++;
                }
        }      
        
        if(count0 == count1){
            ans = N;
        }else if(count0 > count1){
            ans = count1 * 2;
        }else{
            ans = count0 * 2;
        }
        
        System.out.print(ans);
        
    }
    
} public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        int N = S.length();
        String n[] = new String[N];
        int ans = 0;
        int count0 = 0;
        int count1 = 0;
        
        for(int i = 0 ; i < N ; i++){
                n[i] = String.valueOf(S.charAt(i));
                if(n[i].equals("0")){
                    count0++;
                }else if(n[i].equals("1")){
                    count1++;
                }
        }      
        
        if(count0 == count1){
            ans = N;
        }else if(count0 > count1){
            ans = count1 * 2;
        }else{
            ans = count0 * 2;
        }
        
        System.out.print(ans);
        
    }
    
} 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();
        String n[] = new String[N];
        int ans = 0;
        int count0 = 0;
        int count1 = 0;
        
        for(int i = 0 ; i < N ; i++){
                n[i] = String.valueOf(S.charAt(i));
                if(n[i].equals("0")){
                    count0++;
                }else if(n[i].equals("1")){
                    count1++;
                }
        }      
        
        if(count0 == count1){
            ans = N;
        }else if(count0 > count1){
            ans = count1 * 2;
        }else{
            ans = count0 * 2;
        }
        
        System.out.print(ans);
        
    }
    
}
