function main(input) {
  var length = input.length;
  var count00 = 0;
  var count11 = 0;
  var count01 = 0;
  var count10 = 0;
  var loop = input.length%2 === 0 ? input.length : input.length-1;
  // console.log(input.length);
  for(var i=0; i<loop; ){
    var target = input.substring(i, i+2);
    // console.log(target);
    if(target === "00"){
      count00++;
    }
    if(target === "11"){
      count11++;
    }
    if(target === "01"){
      count01++;
    }
    if(target === "10"){
      count10++;
    }
    i+=2;
  }
  
  var pt01 = (count01*2) + count00 + count11;
  var pt10 = (count10*2) + count00 + count11;

  if(input.indexOf(input.length-1) === 1){
    // 0101010101...
    // 末尾が1
    pt01++;
  }else{
    // 末尾が0
    pt10++;
  }
  console.log(Math.min(pt01, pt10));
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'));
// main("10010010");
