function Main(input) {
  var list = input.split("");
  var S = Array(list.length);
  var N = list.length;
  var count = 0;
  var color = 0;
  var ans = 0;
  
  for(i=0;i<list.length;i++){
    S[i] = parseInt(list[i]);
  }
  
  for(i=0;i<N;i++){
    if (S[i] == color) count++;
    color = (color + 1)%2;
  }
  if (N - count > count) ans = count;
  else ans = N - count
    
  console.log(ans);
}
 
Main(require("fs").readFileSync("/dev/stdin", "utf8"));