zero = "01" * 10**5

one = "10" * 10**5

s = str(eval(input()))

ans1 = 0

ans2 = 0

for i, j in zip(s, zero):

    if i != j:

        ans1 += 1

for i, j in zip(s, one):

    if i != j:

        ans2 += 1

print((min(ans1, ans2)))

s = str(eval(input()))

ans1 = s[::2].count("0") + s[1::2].count("1")

ans2 = s[::2].count("1") + s[1::2].count("0")

print((min(ans1, ans2)))
zero = "01" * 10**5
one = "10" * 10**5
s = str(eval(input()))
ans1 = 0
ans2 = 0
for i, j in zip(s, zero):
    if i != j:
        ans1 += 1
for i, j in zip(s, one):
    if i != j:
        ans2 += 1
print((min(ans1, ans2)))

s = str(eval(input()))
ans1 = s[::2].count("0") + s[1::2].count("1")
ans2 = s[::2].count("1") + s[1::2].count("0")
print((min(ans1, ans2)))

-zero = "01" * 10**5 -one = "10" * 10**5 -ans1 = 0 -ans2 = 0 -for i, j in zip(s, zero): -    if i != j: -        ans1 += 1 -for i, j in zip(s, one): -    if i != j: -        ans2 += 1 +ans1 = s[::2].count("0") + s[1::2].count("1") +ans2 = s[::2].count("1") + s[1::2].count("0")