function Main(input){
	var i = 0;
    var lastChar = input[0];
  	var count = 0;
  
	for ( i = 1; i < input.length ; i++ ){
		if (lastChar === input[i]) {
 			if (input[i] === "0") {
            	lastChar = "1";
            } else { 
            	lastChar = "0";
            }
            count += 1;
        } else { 
      		lastChar = input[i];
        }
    }
  	console.log(count);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));