"use strict"

function Main(input) {
  //input = input.split('\n');
  let odd = 0;
  let even = 0;
  for (let i=0;i<input.length;i++){
    if(i%2){
      if(input.charAt(i) == '0'){
        even++;
      } else {
        odd++;
      }
    } else {
      if(input.charAt(i) == '0'){
        odd++;
      } else {
        even++;
      }
    }
  }
  console.log(Math.min(odd, even))
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
