S = eval(input())

N = len(S) # タイルの数



a = sum((1 << i) for i in range(0, N, 2)) # 0b ...0101

b = sum((1 << i) for i in range(1, N, 2)) # 0b ...1010



a_flip = bin(a ^ int(S, base = 2))

b_flip = bin(b ^ int(S, base = 2))



print((min(a_flip[2:].count('1'), b_flip[2:].count('1'))))
S = eval(input())

N = len(S) # タイルの数



a = sum((1 << i) for i in range(0, N, 2)) # 0b ...0101

a_flip = bin(a ^ int(S, base = 2))[2:].count('1')



print((min(a_flip, N - a_flip)))

S = eval(input())
N = len(S)  # タイルの数
a = sum((1 << i) for i in range(0, N, 2))  # 0b ...0101
b = sum((1 << i) for i in range(1, N, 2))  # 0b ...1010
a_flip = bin(a ^ int(S, base=2))
b_flip = bin(b ^ int(S, base=2))
print((min(a_flip[2:].count("1"), b_flip[2:].count("1"))))

S = eval(input())
N = len(S)  # タイルの数
a = sum((1 << i) for i in range(0, N, 2))  # 0b ...0101
a_flip = bin(a ^ int(S, base=2))[2:].count("1")
print((min(a_flip, N - a_flip)))

-b = sum((1 << i) for i in range(1, N, 2))  # 0b ...1010 -a_flip = bin(a ^ int(S, base=2)) -b_flip = bin(b ^ int(S, base=2)) -print((min(a_flip[2:].count("1"), b_flip[2:].count("1")))) +a_flip = bin(a ^ int(S, base=2))[2:].count("1") +print((min(a_flip, N - a_flip)))