function Main(input) {
  input = input.split("\n");
  var S = input[0].split("").map(x => ~~x);
  dp = [...Array(S.length)].fill(0);

  dp[0]=0;

  for(var i=0; i < S.length; i++){
    if(S[i+1] == S[i]){
      dp[i+1]=dp[i]+1;
      if(S[i+1] == 0){
        S[i+1]=1;
      }else if(S[i+1] == 1){
        S[i+1]=0;
      }
    }else{
      dp[i+1]=dp[i];
    }
  }
console.log(dp[S.length-1]);

}

var input=Main(require("fs").readFileSync("/dev/stdin", "utf8"));
// var input=`000`
// Main(input);
