"use strict";

function Main(input) {
    let s = input;

    let answer = 0;
    while (true) {
        let idx = s.indexOf("01");

        if (idx === -1) {
            break;
        }

        answer += 2;
        s = s.slice(0, idx) + s.slice(idx + 2);
    }

    console.log(answer);
}

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