const makeOdd = (l, isFirstZero) => {
  var isZero = !isFirstZero
  return Array.from({ length: l }).map(i => {
    isZero = !isZero
    return isZero ? "0" : "1"
  })
}

function main(input) {
  const inp = input.trim()
  const gt1 = makeOdd(inp.length, true)
  const gt2 = makeOdd(inp.length, false)
  var a1 = inp.split("").filter((char, c) => gt1[c] !== char).length
  var a2 = inp.split("").filter((char, c) => gt2[c] !== char).length
  console.log(a1 < a2 ? a1.toString() : a2.toString())
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));