function Picker(input) {
  var lines = input.split('\n');
  var fields = lines.reduce(function(all, line) { return all.concat(line.split(' ')); }, []);
  var p = 0;

  return {
    int: function() {
      return parseInt(fields[p++], 10);
    },
    float: function() {
      return parseFloat(fields[p++]);
    },
    str: function() {
      return fields[p++];
    }
  };
}

function Main(input) {
  var pick = Picker(input);
  var s = pick.str();

  var c1 =0;
  var c2 = 0;
  for (var i = 0; i < s.length; ++i) {
    if (s[i] == i % 2) {
      c1++;
    } else {
      c2++;
    }
  }

  console.log(c1 < c2 ? c1 : c2);
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));