"use strict";
function I(s,f){this._s=s.split("\n");this._c=0;this._l=0;this._f=f||Number}I.prototype.a=function(){var l=this._s[this._l];if(!l)return;var t=l.trim().split(" ");var a=t[this._c];this._c++;if(t.length===this._c){this._c=0;this._l++}return this._f(a)};I.prototype.l=function(){var l=this._s[this._l];if(!l)return;this._c=0;this._l++;return l.split(" ").map(this._f)};

function main(input) {
  const o = new I(input, String);

  var s = o.a();

  var s1 = "01".repeat(Math.floor(s.length / 2));
  s1 += (s.length % 2) === 0 ? "" : "0"; //01010
  var s2 = "10".repeat(Math.floor(s.length / 2)); //01010
  s2 += (s.length) % 2 === 0 ? "" : "1";

  var s1c = 0;
  var s2c = 0;
  for (var i = 0; i <s.length; i++) {
    if(s[i]!== s1[i]) s1c+=1;
    if(s[i]!== s2[i]) s2c+=1;
  }
  console.log(Math.min(s1c,s2c));
}


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