"use strict";
function Main(input) {
    let lines = input.split("\n");
    let S = lines.shift().split(/\s/)[0].split("").map((v) => v - 0);
    let N = S.length;
    let ans0 = 0, ans1 = 0;
    for (let n = 0; n < N; n++) {
        if (n % 2 == 0) {
            if (S[n] == 1) ans0++; else ans1++;
        } else {
            if (S[n] == 0) ans0++; else ans1++;
        }
    }
    console.log(Math.min(ans0, ans1));
}
if (typeof window == "undefined") Main(require("fs").readFileSync("/dev/stdin", "utf8"));