S = list(eval(input()))

ans1 = 0

ans2 = 0



tmp = S[0]

for i in range(1, len(S)):

    if tmp == S[i]:

        ans1 += 1

        tmp = "0" if tmp == "1" else "1"

    else:

        tmp = S[i]





tmp = S[-1]

for i in reversed(list(range(0, len(S)-1))):

    if tmp == S[i]:

        ans2 += 1

        tmp = "0" if tmp == "1" else "1"

    else:

        tmp = S[i]



print((min(ans1, ans2)))

s = eval(input())

odd = s[0::2]

even = s[1::2]



odd0 = odd.count("0")

odd1 = odd.count("1")

even0 = even.count("0")

even1 = even.count("1")



print((min((odd0 + even1), (odd1 + even0))))

S = list(eval(input()))
ans1 = 0
ans2 = 0
tmp = S[0]
for i in range(1, len(S)):
    if tmp == S[i]:
        ans1 += 1
        tmp = "0" if tmp == "1" else "1"
    else:
        tmp = S[i]
tmp = S[-1]
for i in reversed(list(range(0, len(S) - 1))):
    if tmp == S[i]:
        ans2 += 1
        tmp = "0" if tmp == "1" else "1"
    else:
        tmp = S[i]
print((min(ans1, ans2)))

s = eval(input())
odd = s[0::2]
even = s[1::2]
odd0 = odd.count("0")
odd1 = odd.count("1")
even0 = even.count("0")
even1 = even.count("1")
print((min((odd0 + even1), (odd1 + even0))))

-S = list(eval(input())) -ans1 = 0 -ans2 = 0 -tmp = S[0] -for i in range(1, len(S)): -    if tmp == S[i]: -        ans1 += 1 -        tmp = "0" if tmp == "1" else "1" -    else: -        tmp = S[i] -tmp = S[-1] -for i in reversed(list(range(0, len(S) - 1))): -    if tmp == S[i]: -        ans2 += 1 -        tmp = "0" if tmp == "1" else "1" -    else: -        tmp = S[i] -print((min(ans1, ans2))) +s = eval(input()) +odd = s[0::2] +even = s[1::2] +odd0 = odd.count("0") +odd1 = odd.count("1") +even0 = even.count("0") +even1 = even.count("1") +print((min((odd0 + even1), (odd1 + even0))))