"use strict";
function main(input) {
  const length = input.length;
  // 文字列 "0101・・・"　との差
  // 文字列 "1010・・・"　との差
  let unMatchCont0 = 0;
  let unMatchCont1 = 0;

  for (let i = 0; i < length; i++) {
    if (i % 2 === 0) {
      if (input[i] !== "0") {
        unMatchCont0++;
      } else {
        unMatchCont1++;
      }
    } else {
      if (input[i] !== "1") {
        unMatchCont0++;
      } else {
        unMatchCont1++;
      }
    }
  }
  console.log(Math.min(unMatchCont0, unMatchCont1));
}
main(require("fs").readFileSync("/dev/stdin", "utf8"));
