"use strict";
function main(input) {
  if (input.length === 1) {
    console.log("0");
  } else {
    // 文字列 "0101・・・"　との差
    // 文字列 "1010・・・"　との差
    let unMatchCont0 = 0;
    let unMatchCont1 = 0;
    input.split("").forEach((char, index) => {
      if (index % 2 === 0) {
        if (char != "0") {
          unMatchCont0++;
        } else {
          unMatchCont1++;
        }
      } else {
        if (char != "1") {
          unMatchCont0++;
        } else {
          unMatchCont1++;
        }
      }
    });
    console.log(Math.min(unMatchCont0, unMatchCont1));
  }
}
main(require("fs").readFileSync("/dev/stdin", "utf8"));
