s = eval(input())

n = len(s)



cnt_1 = 0

cnt_2 = 0



#左端のタイルの色が黒

for i in range(n):

  if i % 2 != int(s[i]):

    cnt_1 += 1



#左端のタイルの色が白    

for i in range(n):

  if i % 2 == int(s[i]):

    cnt_2 += 1

      

print((min(cnt_1, cnt_2)))
s = eval(input())



n = len(s)

a = "10" * (n // 2) + "1" * (n % 2)

b = "01" * (n // 2) + "0" * (n % 2)



print((min(bin(int(s, 2) ^ int(a, 2)).count("1"), bin(int(s, 2) ^ int(b, 2)).count("1"))))

s = eval(input())
n = len(s)
cnt_1 = 0
cnt_2 = 0
# 左端のタイルの色が黒
for i in range(n):
    if i % 2 != int(s[i]):
        cnt_1 += 1
# 左端のタイルの色が白
for i in range(n):
    if i % 2 == int(s[i]):
        cnt_2 += 1
print((min(cnt_1, cnt_2)))

s = eval(input())
n = len(s)
a = "10" * (n // 2) + "1" * (n % 2)
b = "01" * (n // 2) + "0" * (n % 2)
print(
    (min(bin(int(s, 2) ^ int(a, 2)).count("1"), bin(int(s, 2) ^ int(b, 2)).count("1")))
)

-cnt_1 = 0 -cnt_2 = 0 -# 左端のタイルの色が黒 -for i in range(n): -    if i % 2 != int(s[i]): -        cnt_1 += 1 -# 左端のタイルの色が白 -for i in range(n): -    if i % 2 == int(s[i]): -        cnt_2 += 1 -print((min(cnt_1, cnt_2))) +a = "10" * (n // 2) + "1" * (n % 2) +b = "01" * (n // 2) + "0" * (n % 2) +print( +    (min(bin(int(s, 2) ^ int(a, 2)).count("1"), bin(int(s, 2) ^ int(b, 2)).count("1"))) +)