s = list(eval(input()))



ans = 0

for i in range(len(s)-1):

    if int(s[i]) == int(s[i+1]) == 0:

        s[i+1] = 1

        ans += 1

    elif int(s[i]) == int(s[i+1]) == 1:

        s[i+1] = 0

        ans += 1

print(ans)



s = eval(input())



a = "01"*int(len(s)/2) + "0"*int(len(s)%2)

b = "10"*int(len(s)/2) + "1"*int(len(s)%2)



a_count = 0

b_count = 0

for i, j, k in zip(a, b, s):

    if i != k:

        a_count += 1

    if j != k:

        b_count += 1



print((min(a_count, b_count)))

s = list(eval(input()))
ans = 0
for i in range(len(s) - 1):
    if int(s[i]) == int(s[i + 1]) == 0:
        s[i + 1] = 1
        ans += 1
    elif int(s[i]) == int(s[i + 1]) == 1:
        s[i + 1] = 0
        ans += 1
print(ans)

s = eval(input())
a = "01" * int(len(s) / 2) + "0" * int(len(s) % 2)
b = "10" * int(len(s) / 2) + "1" * int(len(s) % 2)
a_count = 0
b_count = 0
for i, j, k in zip(a, b, s):
    if i != k:
        a_count += 1
    if j != k:
        b_count += 1
print((min(a_count, b_count)))

-s = list(eval(input())) -ans = 0 -for i in range(len(s) - 1): -    if int(s[i]) == int(s[i + 1]) == 0: -        s[i + 1] = 1 -        ans += 1 -    elif int(s[i]) == int(s[i + 1]) == 1: -        s[i + 1] = 0 -        ans += 1 -print(ans) +s = eval(input()) +a = "01" * int(len(s) / 2) + "0" * int(len(s) % 2) +b = "10" * int(len(s) / 2) + "1" * int(len(s) % 2) +a_count = 0 +b_count = 0 +for i, j, k in zip(a, b, s): +    if i != k: +        a_count += 1 +    if j != k: +        b_count += 1 +print((min(a_count, b_count)))