import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        String s = sc.next();
        char [] cs = s.toCharArray();
        int n = s.length();

        // Key insight: as long as #0's > 0 and #1's > 1, there will always be a 0 and 1 touching somewhere. Reason: any streak of say 0's must have in at least one of the ends a 1

        int numZeros = 0;
        int numOnes = 0;

        for (char c : cs) {
            if (c == '0') {
                numZeros++;
            } else {
                numOnes++;
            }
        }

        System.out.println(2 * Math.min(numZeros, numOnes));
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        String s = sc.next();
        char [] cs = s.toCharArray();
        int n = s.length();

        // Key insight: as long as #0's > 0 and #1's > 1, there will always be a 0 and 1 touching somewhere. Reason: any streak of say 0's must have in at least one of the ends a 1

        int numZeros = 0;
        int numOnes = 0;

        for (char c : cs) {
            if (c == '0') {
                numZeros++;
            } else {
                numOnes++;
            }
        }

        System.out.println(2 * Math.min(numZeros, numOnes));
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        String s = sc.next();
        char [] cs = s.toCharArray();
        int n = s.length();

        // Key insight: as long as #0's > 0 and #1's > 1, there will always be a 0 and 1 touching somewhere. Reason: any streak of say 0's must have in at least one of the ends a 1

        int numZeros = 0;
        int numOnes = 0;

        for (char c : cs) {
            if (c == '0') {
                numZeros++;
            } else {
                numOnes++;
            }
        }

        System.out.println(2 * Math.min(numZeros, numOnes));
    } main {
        Scanner sc = new Scanner(System.in);

        String s = sc.next();
        char [] cs = s.toCharArray();
        int n = s.length();

        // Key insight: as long as #0's > 0 and #1's > 1, there will always be a 0 and 1 touching somewhere. Reason: any streak of say 0's must have in at least one of the ends a 1

        int numZeros = 0;
        int numOnes = 0;

        for (char c : cs) {
            if (c == '0') {
                numZeros++;
            } else {
                numOnes++;
            }
        }

        System.out.println(2 * Math.min(numZeros, numOnes));
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String s = sc.next(); s sc.next() sc.next sc char [] cs = s.toCharArray(); cs s.toCharArray() s.toCharArray s int n = s.length(); n s.length() s.length s int numZeros = 0; numZeros 0 int numOnes = 0; numOnes 0 for (char c : cs) {
            if (c == '0') {
                numZeros++;
            } else {
                numOnes++;
            }
        } char c cs {
            if (c == '0') {
                numZeros++;
            } else {
                numOnes++;
            }
        } {
            if (c == '0') {
                numZeros++;
            } else {
                numOnes++;
            }
        } if (c == '0') {
                numZeros++;
            } else {
                numOnes++;
            } c == '0' c '0' {
                numZeros++;
            } numZeros++ numZeros {
                numOnes++;
            } numOnes++ numOnes System.out.println(2 * Math.min(numZeros, numOnes)) System.out.println System.out System System.out 2 * Math.min(numZeros, numOnes) 2 Math.min(numZeros, numOnes) Math.min Math numZeros numOnes String[] args args public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        String s = sc.next();
        char [] cs = s.toCharArray();
        int n = s.length();

        // Key insight: as long as #0's > 0 and #1's > 1, there will always be a 0 and 1 touching somewhere. Reason: any streak of say 0's must have in at least one of the ends a 1

        int numZeros = 0;
        int numOnes = 0;

        for (char c : cs) {
            if (c == '0') {
                numZeros++;
            } else {
                numOnes++;
            }
        }

        System.out.println(2 * Math.min(numZeros, numOnes));
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        String s = sc.next();
        char [] cs = s.toCharArray();
        int n = s.length();

        // Key insight: as long as #0's > 0 and #1's > 1, there will always be a 0 and 1 touching somewhere. Reason: any streak of say 0's must have in at least one of the ends a 1

        int numZeros = 0;
        int numOnes = 0;

        for (char c : cs) {
            if (c == '0') {
                numZeros++;
            } else {
                numOnes++;
            }
        }

        System.out.println(2 * Math.min(numZeros, numOnes));
    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        String s = sc.next();
        char [] cs = s.toCharArray();
        int n = s.length();

        // Key insight: as long as #0's > 0 and #1's > 1, there will always be a 0 and 1 touching somewhere. Reason: any streak of say 0's must have in at least one of the ends a 1

        int numZeros = 0;
        int numOnes = 0;

        for (char c : cs) {
            if (c == '0') {
                numZeros++;
            } else {
                numOnes++;
            }
        }

        System.out.println(2 * Math.min(numZeros, numOnes));
    }
}