S = eval(input())



l = "01" * (len(S)//2) + ("0" if len(S)%2 == 1 else "")



l = [int(x) + int(y) for (x,y) in zip(S,l)]



print((min(l.count(1),(l.count(0)+l.count(2)))))

S = list(map(int,eval(input())))



l =[0,1] * (len(S)//2) + ([0] if len(S)%2 == 1 else [])



l = [x + y for (x,y) in zip(S,l)]



print((min(l.count(1),(l.count(0)+l.count(2)))))

S = eval(input())
l = "01" * (len(S) // 2) + ("0" if len(S) % 2 == 1 else "")
l = [int(x) + int(y) for (x, y) in zip(S, l)]
print((min(l.count(1), (l.count(0) + l.count(2)))))

S = list(map(int, eval(input())))
l = [0, 1] * (len(S) // 2) + ([0] if len(S) % 2 == 1 else [])
l = [x + y for (x, y) in zip(S, l)]
print((min(l.count(1), (l.count(0) + l.count(2)))))

-S = eval(input()) -l = "01" * (len(S) // 2) + ("0" if len(S) % 2 == 1 else "") -l = [int(x) + int(y) for (x, y) in zip(S, l)] +S = list(map(int, eval(input()))) +l = [0, 1] * (len(S) // 2) + ([0] if len(S) % 2 == 1 else []) +l = [x + y for (x, y) in zip(S, l)]