function Main(input) {
  var N = input.length;
  var count = 0;
  var color = 0;
  
  for(i=0;i<N;i++){
    if (parseInt(input.charAt(i)) == color) count++;
    color = (color + 1)%2;
  }
  console.log(Math.min(count,N-count));
}
 
Main(require("fs").readFileSync("/dev/stdin", "utf8"));