"use strict";

function Main(input) {
  var S = [...input.split("\n")[0]].map(function (v) {
    return parseInt(v, 10);
  });
  var A = S.reduce(function (a, c, i) {
    a += c % 2 == i % 2 ? 1 : 0;
    return a;
  }, 0);
  var B = S.reduce(function (a, c, i) {
    a += c % 2 != i % 2 ? 1 : 0;
    return a;
  }, 0);
  console.log(Math.min(A, B));
} 
Main(require("fs").readFileSync("/dev/stdin", "utf8"));