S = eval(input())

n = len(S)

ans1, ans2 = 0, 0

for i, s in enumerate(S):

    m = int(s)

    if i % 2:

        ans1 += 1 - m

        ans2 += m

    else:

        ans1 += m

        ans2 += 1 - m

print((min(ans1, ans2)))
s = eval(input())

# 偶数番目, 奇数番目を取り出すならスライス使おう!

c = s[::2].count('0') + s[1::2].count('1')

print((min(c, len(s)-c)))
S = eval(input())
n = len(S)
ans1, ans2 = 0, 0
for i, s in enumerate(S):
    m = int(s)
    if i % 2:
        ans1 += 1 - m
        ans2 += m
    else:
        ans1 += m
        ans2 += 1 - m
print((min(ans1, ans2)))

s = eval(input())
# 偶数番目, 奇数番目を取り出すならスライス使おう!
c = s[::2].count("0") + s[1::2].count("1")
print((min(c, len(s) - c)))

-S = eval(input()) -n = len(S) -ans1, ans2 = 0, 0 -for i, s in enumerate(S): -    m = int(s) -    if i % 2: -        ans1 += 1 - m -        ans2 += m -    else: -        ans1 += m -        ans2 += 1 - m -print((min(ans1, ans2))) +s = eval(input()) +# 偶数番目, 奇数番目を取り出すならスライス使おう! +c = s[::2].count("0") + s[1::2].count("1") +print((min(c, len(s) - c)))