S = eval(input())



s0 = [0 for i in range(len(S))]

s1 = [1 for i in range(len(S))]

for i in range(0, len(S), 2):

    s0[i] = (s0[i] + 1) % 2

    s1[i] = (s1[i] + 1) % 2



s0 = ''.join(map(str, s0))

s1 = ''.join(map(str, s1))





def cnt(x):

    cnt = 0

    while x > 0:

        cnt += x & 1

        x = x >> 1

    return cnt





print((min(cnt(int(S, 2) ^ int(s0, 2)), cnt(int(S, 2) ^ int(s1, 2)))))

S = eval(input())



s0 = 0

s1 = 0

for i, s in enumerate(list(S)):

    s0 += int(str(i % 2) == s)

    s1 += int(str((i + 1) % 2) == s)

print((min(s0, s1)))

S = eval(input())
s0 = [0 for i in range(len(S))]
s1 = [1 for i in range(len(S))]
for i in range(0, len(S), 2):
    s0[i] = (s0[i] + 1) % 2
    s1[i] = (s1[i] + 1) % 2
s0 = "".join(map(str, s0))
s1 = "".join(map(str, s1))


def cnt(x):
    cnt = 0
    while x > 0:
        cnt += x & 1
        x = x >> 1
    return cnt


print((min(cnt(int(S, 2) ^ int(s0, 2)), cnt(int(S, 2) ^ int(s1, 2)))))

S = eval(input())
s0 = 0
s1 = 0
for i, s in enumerate(list(S)):
    s0 += int(str(i % 2) == s)
    s1 += int(str((i + 1) % 2) == s)
print((min(s0, s1)))

-s0 = [0 for i in range(len(S))] -s1 = [1 for i in range(len(S))] -for i in range(0, len(S), 2): -    s0[i] = (s0[i] + 1) % 2 -    s1[i] = (s1[i] + 1) % 2 -s0 = "".join(map(str, s0)) -s1 = "".join(map(str, s1)) - - -def cnt(x): -    cnt = 0 -    while x > 0: -        cnt += x & 1 -        x = x >> 1 -    return cnt - - -print((min(cnt(int(S, 2) ^ int(s0, 2)), cnt(int(S, 2) ^ int(s1, 2))))) +s0 = 0 +s1 = 0 +for i, s in enumerate(list(S)): +    s0 += int(str(i % 2) == s) +    s1 += int(str((i + 1) % 2) == s) +print((min(s0, s1)))