function setUp(input) {
  input = input.split("\n");
  S = input[0];
  sList = S.split('');
  main();
}
function main() {
  var countOdd = 0;
  var countEven = 0;
  sList.forEach(function (d, i) {
    var target = i % 2;
    var oddTarget = target ? '0' : '1';
    var evenTarget = target ? '1' : '0';
    if (d != oddTarget) {
      countOdd++;
    }
    if (d != evenTarget) {
      countEven++;
    }
  })
  console.log(Math.min(countOdd, countEven));
}

setUp(require("fs").readFileSync("/dev/stdin", "utf8"));