"use strict"
function main(arg) {
    const S = arg.split("\n")[0].split("").map((x)=>{return parseInt(x)})
    let i, x = 0, y = 0
    for (i = 0; i < S.length; ++i){
        (i%2 == S[i]) ? x++ : y++
    }
    console.log((x<y)?x:y)
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));