function Main(input) {
  "use strict";
	const chars = input.split("");

  const count = chars.length;
  let n = 0;
  let prev = chars[0];
  for (let i = 1; i < count; i++) {
    const c = chars[i];
    if ( c === prev) {
      n++;
      prev = c === "1" ? "0" : "1";
    } else {
      prev = c;
    }
  }

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