"use strict";
function Main(input) {
    let S = input.split("\n")[0];
    let s = S.split('').map((v) => +v);
    let ans = 0, f = true;
    while (f) {
        f = false;
        for (let n = 0; n < s.length - 1; n++) {
            if (s[n] + s[n+1] == 1) {
                ans += 2;
                s.splice(n, 2);
                n -= 2;
            }
        }
    }
    console.log(ans);
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));
