import std.algorithm;
import std.array;
import std.conv;
import std.math;
import std.range;
import std.stdio;
import std.string;
import std.typecons;

T read(T)() { return readln.chomp.to!T; }
T[] reads(T)() { return readln.split.to!(T[]); }
alias readint = read!int;
alias readints = reads!int;

int calc(string s) {

    int rec(int head) {
        int change = 0;
        for (int i = 0; i < s.length; i += 2) {
            if (s[i] != (head == 0 ? '0' : '1'))
                change++;

            if (i+1 < s.length && s[i+1] != (head == 0 ? '1' : '0'))
                change++;
        }
        return change;
    }

    return min(rec(0), rec(1));
}

void main() {
    string s = read!string;
    writeln(calc(s));
}

