"use strict";
    
const main = arg => {
    arg = arg.trim().split("\n");
    const S = arg[0].split("").map(n=>parseInt(n));
    
    let startWith0 = Array(S.length).fill(0).map((val,idx)=>idx % 2 !== 0 ? val = 1 : val = 0);
    let startWith1 = Array(S.length).fill(0).map((val,idx)=>idx % 2 !== 0 ? val = 0 : val = 1);
    
    let diffStartWith0 = 0;
    let diffStartWith1 = 0;

    S.forEach((val,idx) => {
        if(S[idx] !== startWith0[idx]) {
            diffStartWith0++;
        }
        
        if(S[idx] !== startWith1[idx]) {
            diffStartWith1++;
        }
    });
    
    console.log(Math.min(diffStartWith0, diffStartWith1));
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));