S = eval(input())

ans0 = 0

ans1 = 0

for i in range(len(S)):

    if i%2 == 0:

        if S[i] == '0':

            ans1 += 1

        else:

            ans0 += 1

    else:

        if S[i] == '1':

            ans1 += 1

        else:

            ans0 += 1

print((min(ans0,ans1)))
S = eval(input())

a = S[::2]

b = S[1::2]

A = a.count('0')+b.count('1')

print((min(A,len(S)-A)))
S = eval(input())
ans0 = 0
ans1 = 0
for i in range(len(S)):
    if i % 2 == 0:
        if S[i] == "0":
            ans1 += 1
        else:
            ans0 += 1
    else:
        if S[i] == "1":
            ans1 += 1
        else:
            ans0 += 1
print((min(ans0, ans1)))

S = eval(input())
a = S[::2]
b = S[1::2]
A = a.count("0") + b.count("1")
print((min(A, len(S) - A)))

-ans0 = 0 -ans1 = 0 -for i in range(len(S)): -    if i % 2 == 0: -        if S[i] == "0": -            ans1 += 1 -        else: -            ans0 += 1 -    else: -        if S[i] == "1": -            ans1 += 1 -        else: -            ans0 += 1 -print((min(ans0, ans1))) +a = S[::2] +b = S[1::2] +A = a.count("0") + b.count("1") +print((min(A, len(S) - A)))