"use strict";
function Main(input) {
    let s = input.split("\n")[0];
    let c = 0, f = true;
    while (f) {
        f = false;
        let ss = '';
        for (let n = 0; n < s.length - 1; n++) {
            let c0 = s.charAt(n);
            let c1 = s.charAt(n + 1);
            if ((c0 == '0' && c1 == '1') || (c0 == '1' && c1 == '0')) {
                c += 1;
                n += 1;
                f = true;
            } else ss += c0;
        }
        if (ss.length > 0 && f) s = ss;
        else {
            console.log(c*2);
            return;
        }
    }
}

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