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) # タイルの数



flip = sum( 1 ^ int(S[i]) for i in range(0, N, 2))

flip += sum( 0 ^ int(S[i]) for i in range(1, N, 2))



print((min(flip, N - flip)))

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)  # タイルの数
flip = sum(1 ^ int(S[i]) for i in range(0, N, 2))
flip += sum(0 ^ int(S[i]) for i in range(1, N, 2))
print((min(flip, N - flip)))

-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))) +flip = sum(1 ^ int(S[i]) for i in range(0, N, 2)) +flip += sum(0 ^ int(S[i]) for i in range(1, N, 2)) +print((min(flip, N - flip)))