import java.util.Scanner;

class Main {
    public static void main(final String[] args) {
        Scanner scan = new Scanner(System.in);
        String s = scan.nextLine();
        int zero = 0;
        int one = 0;
        for (int i = 0; i < s.length(); i++) {
            if (s.charAt(i) == '0') {
                zero++;
            }else {
                one++;
            }
        }
        int ans = one + zero;
        if (zero < one) {
            ans += zero- one;
        } else {
            ans +=one - zero;
        }
        System.out.println(ans);
    }
} import java.util.Scanner; Scanner java.util class Main {
    public static void main(final String[] args) {
        Scanner scan = new Scanner(System.in);
        String s = scan.nextLine();
        int zero = 0;
        int one = 0;
        for (int i = 0; i < s.length(); i++) {
            if (s.charAt(i) == '0') {
                zero++;
            }else {
                one++;
            }
        }
        int ans = one + zero;
        if (zero < one) {
            ans += zero- one;
        } else {
            ans +=one - zero;
        }
        System.out.println(ans);
    }
} Main public static void main(final String[] args) {
        Scanner scan = new Scanner(System.in);
        String s = scan.nextLine();
        int zero = 0;
        int one = 0;
        for (int i = 0; i < s.length(); i++) {
            if (s.charAt(i) == '0') {
                zero++;
            }else {
                one++;
            }
        }
        int ans = one + zero;
        if (zero < one) {
            ans += zero- one;
        } else {
            ans +=one - zero;
        }
        System.out.println(ans);
    } main {
        Scanner scan = new Scanner(System.in);
        String s = scan.nextLine();
        int zero = 0;
        int one = 0;
        for (int i = 0; i < s.length(); i++) {
            if (s.charAt(i) == '0') {
                zero++;
            }else {
                one++;
            }
        }
        int ans = one + zero;
        if (zero < one) {
            ans += zero- one;
        } else {
            ans +=one - zero;
        }
        System.out.println(ans);
    } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) String s = scan.nextLine(); s scan.nextLine() scan.nextLine scan int zero = 0; zero 0 int one = 0; one 0 for (int i = 0; i < s.length(); i++) {
            if (s.charAt(i) == '0') {
                zero++;
            }else {
                one++;
            }
        } int i = 0; int i = 0; i 0 i < s.length() i s.length() s.length s i++ i++ i {
            if (s.charAt(i) == '0') {
                zero++;
            }else {
                one++;
            }
        } {
            if (s.charAt(i) == '0') {
                zero++;
            }else {
                one++;
            }
        } if (s.charAt(i) == '0') {
                zero++;
            }else {
                one++;
            } s.charAt(i) == '0' s.charAt(i) s.charAt s i '0' {
                zero++;
            } zero++ zero {
                one++;
            } one++ one int ans = one + zero; ans one + zero one zero if (zero < one) {
            ans += zero- one;
        } else {
            ans +=one - zero;
        } zero < one zero one {
            ans += zero- one;
        } ans += zero- one ans zero- one zero one {
            ans +=one - zero;
        } ans +=one - zero ans one - zero one zero System.out.println(ans) System.out.println System.out System System.out ans final String[] args args
import java.util.Scanner;

class Main {
    public static void main(final String[] args) {
        Scanner scan = new Scanner(System.in);
        String s = scan.nextLine();
        int zero = 0;
        int one = 0;
        for (int i = 0; i < s.length(); i++) {
            if (s.charAt(i) == '0') {
                zero++;
            }else {
                one++;
            }
        }
        int ans = one + zero;
        if (zero < one) {
            ans += zero- one;
        } else {
            ans +=one - zero;
        }
        System.out.println(ans);
    }
}