'use strict'
function Main(input) {
    input = input.split("\n")
    const string = input[0].split('').map(i => {
      return parseInt(i, 10)
    })

    const arrayN = [...Array(string.length).keys()]
    let model0 = []
    let model1 = []

    arrayN.forEach(v => {
      if(v % 2 == 0) {
        model0.push(0)
        model1.push(1)
      } else {
        model0.push(1)
        model1.push(0)
      }
    })

    const result0 = string.filter((v, i) => {
      return v !== model0[i]
    }).length

    const result1 = string.filter((v, i) => {
      return v !== model1[i]
    }).length

    console.log(Math.min(result0, result1))

}
Main(require("fs").readFileSync("/dev/stdin", "utf8"))