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