input = require('fs').readFileSync('/dev/stdin', 'utf8')
lines = input.split('\n')
S = lines.shift()

a = 0
b = 0
for (i=0; i<S.length; i++) {
    if (S[i] != (i % 2 == 0 ? '0' : '1')) {
        a++
    }
    if (S[i] != (i % 2 == 1 ? '0' : '1')) {
        b++
    }
}

console.log(Math.min(a, b))