"use strict";
function Main(input) {
    let s = input.split("\n")[0];
    let c = 0, f = true;
    while (f) {
        for (let n = 0; n < s.length - 1; n++) {
            let b = s.substr(n, 2);
            if (b == '01' || b == '10') {
                c += 1;
                if (n == 0) s = s.substring(n + 2);
                else {
                    s = s.substr(0, n) + s.substring(n + 2);
                }
                n = -1;
            }
        }
        console.log(c*2);
        return;
    }
}

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