import std.stdio, std.conv, std.string, std.array, std.range, std.algorithm;

void main(){
  auto s = readln.strip;

  long a = 0;
  long b = 0;
  foreach (i, c; s) {
    if ((i % 2 == 0) == (c == '1')) {
      a++;
    } else {
      b++;
    }
  }

  writeln(min(a, b));
}
