function Main(input) {
    const S = input;
    var countA = 0;
    var countB = 0;
    var prevA = 0;
    var P = ["0", "1"];
    Array.prototype.forEach.call(S, function(s) {
        if(P[prevA] == s) {
            countA++;
        } else {
            countB++;
        }
        prevA = (prevA + 1) % 2;
    });

    console.log(Math.min(countA, countB));
}

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