import java.util.*;


public class Main {
    public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        String a = sc.next();
        int beforeSize = a.length();
        int zero = 0;
        int one = 0;
        for (char c : a.toCharArray()) {
            if (c == '0') {
                zero++;
            } else {
                one++;
            }
        }
        int sub = zero - one;
        if (sub < 0) {
            sub = sub * -1;
        }
        System.out.println(beforeSize - sub);
    }
} import java.util.*; util.* java public class Main {
    public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        String a = sc.next();
        int beforeSize = a.length();
        int zero = 0;
        int one = 0;
        for (char c : a.toCharArray()) {
            if (c == '0') {
                zero++;
            } else {
                one++;
            }
        }
        int sub = zero - one;
        if (sub < 0) {
            sub = sub * -1;
        }
        System.out.println(beforeSize - sub);
    }
} Main public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        String a = sc.next();
        int beforeSize = a.length();
        int zero = 0;
        int one = 0;
        for (char c : a.toCharArray()) {
            if (c == '0') {
                zero++;
            } else {
                one++;
            }
        }
        int sub = zero - one;
        if (sub < 0) {
            sub = sub * -1;
        }
        System.out.println(beforeSize - sub);
    } main {
        Scanner sc = new Scanner(System.in);
        String a = sc.next();
        int beforeSize = a.length();
        int zero = 0;
        int one = 0;
        for (char c : a.toCharArray()) {
            if (c == '0') {
                zero++;
            } else {
                one++;
            }
        }
        int sub = zero - one;
        if (sub < 0) {
            sub = sub * -1;
        }
        System.out.println(beforeSize - sub);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String a = sc.next(); a sc.next() sc.next sc int beforeSize = a.length(); beforeSize a.length() a.length a int zero = 0; zero 0 int one = 0; one 0 for (char c : a.toCharArray()) {
            if (c == '0') {
                zero++;
            } else {
                one++;
            }
        } char c a.toCharArray() a.toCharArray a {
            if (c == '0') {
                zero++;
            } else {
                one++;
            }
        } {
            if (c == '0') {
                zero++;
            } else {
                one++;
            }
        } if (c == '0') {
                zero++;
            } else {
                one++;
            } c == '0' c '0' {
                zero++;
            } zero++ zero {
                one++;
            } one++ one int sub = zero - one; sub zero - one zero one if (sub < 0) {
            sub = sub * -1;
        } sub < 0 sub 0 {
            sub = sub * -1;
        } sub = sub * -1 sub sub * -1 sub -1 1 System.out.println(beforeSize - sub) System.out.println System.out System System.out beforeSize - sub beforeSize sub String args[] args public class Main {
    public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        String a = sc.next();
        int beforeSize = a.length();
        int zero = 0;
        int one = 0;
        for (char c : a.toCharArray()) {
            if (c == '0') {
                zero++;
            } else {
                one++;
            }
        }
        int sub = zero - one;
        if (sub < 0) {
            sub = sub * -1;
        }
        System.out.println(beforeSize - sub);
    }
} public class Main {
    public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        String a = sc.next();
        int beforeSize = a.length();
        int zero = 0;
        int one = 0;
        for (char c : a.toCharArray()) {
            if (c == '0') {
                zero++;
            } else {
                one++;
            }
        }
        int sub = zero - one;
        if (sub < 0) {
            sub = sub * -1;
        }
        System.out.println(beforeSize - sub);
    }
} Main
import java.util.*;


public class Main {
    public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        String a = sc.next();
        int beforeSize = a.length();
        int zero = 0;
        int one = 0;
        for (char c : a.toCharArray()) {
            if (c == '0') {
                zero++;
            } else {
                one++;
            }
        }
        int sub = zero - one;
        if (sub < 0) {
            sub = sub * -1;
        }
        System.out.println(beforeSize - sub);
    }
}
