function main(input) {
  if (input.length === 1) {
    console.log("0");
    return;
  }

  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"));
