function Main(input) {
	var inputArr = input.split("");
    var odd  = 0;
    var even = 0;
	for(var i = 0; i < inputArr.length; i = i + 2) {
      if (inputArr[i] === '0') {
          even++;
      }
	}
	for(var i = 1; i < inputArr.length; i = i + 2) {
      if (inputArr[i] === '1') {
          odd++;
      }
	}
  	if ((inputArr.length + 1) / 2 > (even + odd) ) {
    	console.log(even + odd);
    } else {
      	console.log(inputArr.length - (even + odd));
    }
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));