'use strict'
function Main(input) {

  let ptn = input.trim();
  // console.log({ ptn });
  let ZOCount = 0;
  let OZCount = 0;

  for (let i = 0; i < ptn.length; i++) {
    if (ptn[i] !== (i % 2 === 1 ? '0' : '1')) {
      ZOCount += 1;
    }
    if (ptn[i] !== (i % 2 === 0 ? '0' : '1')) {
      OZCount += 1;
    }
  }
  // console.log({ ZOCount, OZCount });

  console.log(Math.min(ZOCount, OZCount));

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