'use strict';

function Main(input) {
  const S1 = input.split("")
  const S2 = input.split("")
  const len = S1.length
  
  // left to right
  let ans1 = 0
  for (let i=1; i<len; i++) {
    if (S1[i] === S1[i-1]) {
      ans1++
      if (S1[i] === "0") {
        S1[i] = "1"
      } else {
        S1[i] = "0"
      }
    }
  }

  // right to left
  let ans2 = 0
  for (let i=len-1; i>-1; i--) {
    if (S2[i] === S2[i+1]) {
      ans2++
      if (S2[i] === "0") {
        S2[i] = "1"
      } else {
        S2[i] = "0"
      }
    }
  }

  console.log(Math.min(ans1, ans2))

};

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