function Main(input) {
  var input = input.split("\n");
  var ary = input[0].split("");
  var even = ary.filter(function(e, i){
    return i%2 == 0 ? e : false;
  });
  var odd = ary.filter(function(e, i){
    return i%2 != 0 ? e : false;
  });

  var evenZero = even.filter(function(e){
    return e == 0;
  });

  var oddZero =  odd.filter(function(e){
    return e == 0;
  });

  var result = 0;
  if(evenZero.length > oddZero.length) {
    result = oddZero.length + (even.length - evenZero.length);
  } else {
    result = evenZero.length  + (odd.length - oddZero.length);
  }
  console.log(result);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));