var l = require('fs').readFileSync('/dev/stdin','utf8').trim().split('');
var db = 0, dw = 0;
for (var i = 0; i < l.length; i++) {
  if (i % 2 === 0) {
    if (l[i] === '0') dw++; else db++;
  } else {
    if (l[i] === '1') dw++; else db++;
  }
}
console.log(Math.min(db, dw));