import java.util.*; 

class Main{
public static void main(String[] args){
	Scanner sc=new Scanner(System.in);
       String s=sc.next();
	   String[] a=s.split("");
		int count1=0;
        int count0=0;

		for(int c=0;c<a.length;c++){
    		if(a[c].equals("0")){
            	count0++;
            }else{
             count1++;
            }
    	}
       int ans=a.length-Math.abs(count0-count1);
    
    	System.out.println(ans);
    }
} import java.util.*; util.* java class Main{
public static void main(String[] args){
	Scanner sc=new Scanner(System.in);
       String s=sc.next();
	   String[] a=s.split("");
		int count1=0;
        int count0=0;

		for(int c=0;c<a.length;c++){
    		if(a[c].equals("0")){
            	count0++;
            }else{
             count1++;
            }
    	}
       int ans=a.length-Math.abs(count0-count1);
    
    	System.out.println(ans);
    }
} Main public static void main(String[] args){
	Scanner sc=new Scanner(System.in);
       String s=sc.next();
	   String[] a=s.split("");
		int count1=0;
        int count0=0;

		for(int c=0;c<a.length;c++){
    		if(a[c].equals("0")){
            	count0++;
            }else{
             count1++;
            }
    	}
       int ans=a.length-Math.abs(count0-count1);
    
    	System.out.println(ans);
    } main {
	Scanner sc=new Scanner(System.in);
       String s=sc.next();
	   String[] a=s.split("");
		int count1=0;
        int count0=0;

		for(int c=0;c<a.length;c++){
    		if(a[c].equals("0")){
            	count0++;
            }else{
             count1++;
            }
    	}
       int ans=a.length-Math.abs(count0-count1);
    
    	System.out.println(ans);
    } Scanner sc=new Scanner(System.in); sc new Scanner(System.in) String s=sc.next(); s sc.next() sc.next sc String[] a=s.split(""); a s.split("") s.split s "" int count1=0; count1 0 int count0=0; count0 0 for(int c=0;c<a.length;c++){
    		if(a[c].equals("0")){
            	count0++;
            }else{
             count1++;
            }
    	} int c=0; int c=0; c 0 c<a.length c a.length a a.length c++ c++ c {
    		if(a[c].equals("0")){
            	count0++;
            }else{
             count1++;
            }
    	} {
    		if(a[c].equals("0")){
            	count0++;
            }else{
             count1++;
            }
    	} if(a[c].equals("0")){
            	count0++;
            }else{
             count1++;
            } a[c].equals("0") a[c].equals a[c] a c "0" {
            	count0++;
            } count0++ count0 {
             count1++;
            } count1++ count1 int ans=a.length-Math.abs(count0-count1); ans a.length-Math.abs(count0-count1) a.length a a.length Math.abs(count0-count1) Math.abs Math count0-count1 count0 count1 System.out.println(ans) System.out.println System.out System System.out ans String[] args args
import java.util.*; 

class Main{
public static void main(String[] args){
	Scanner sc=new Scanner(System.in);
       String s=sc.next();
	   String[] a=s.split("");
		int count1=0;
        int count0=0;

		for(int c=0;c<a.length;c++){
    		if(a[c].equals("0")){
            	count0++;
            }else{
             count1++;
            }
    	}
       int ans=a.length-Math.abs(count0-count1);
    
    	System.out.println(ans);
    }
}
