function Main(input) {
    var S = input;
    var len = S.length;
    var countFirst = 0;
    var countSecond = 0;
    var firstAddStr = '1';
    var secondAddStr = '0';
    for(var i = 0; i < len; i++) {
        if(S.charAt(i) === '') {
            continue;
        }
        if (firstAddStr != S.charAt(i)) {
            countFirst++;
        }
        firstAddStr = firstAddStr === '1' ? '0' : '1';
        if (secondAddStr != S.charAt(i)) {
            countSecond++;
        }
        secondAddStr = secondAddStr === '1' ? '0' : '1';
    }
    var ans = countFirst < countSecond ? countFirst : countSecond;
    console.log(ans);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));