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

void main() {
    const S = readln.chomp;
    2.iota.map!(j => 
        S.length.iota
        .map!(i => to!string((i+j) % 2))
        .join
        .zip(S)
        .filter!(t => t[0] != t[1])
        .walkLength)
    .reduce!min
    .writeln;
}

