let S = readLine()!.characters.map{String($0)}
var ans = S.count
for i in 0..<2 {
    var cnt = 0
    for j in 0..<S.count {
        if (j%2)^i != Int(S[j]) {
            cnt += 1
        }
    }
    ans = min(ans, cnt)
}
print(ans)