
import java.io.*;
import java.util.*;

class Main{
    public static void main(String[] args){
        solve();
    }

    public static void solve(){
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        int n = s.length();
        int count0 = 0;
        int count1 = 0;
        for(int i=0;i<n;i++){
        	if(s.charAt(i)=='0'){
        		count0++;
        	}
        	else{
        		count1++;
        	}
        }
        System.out.println(2*(int)Math.min(count0, count1));
    }
} import java.io.*; io.* java import java.util.*; util.* java class Main{
    public static void main(String[] args){
        solve();
    }

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

import java.io.*;
import java.util.*;

class Main{
    public static void main(String[] args){
        solve();
    }

    public static void solve(){
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        int n = s.length();
        int count0 = 0;
        int count1 = 0;
        for(int i=0;i<n;i++){
        	if(s.charAt(i)=='0'){
        		count0++;
        	}
        	else{
        		count1++;
        	}
        }
        System.out.println(2*(int)Math.min(count0, count1));
    }
}