S = eval(input())

b = 1

B = 0

l = 0

for i in S:

  if int(i) != b:

    B += 1

  b = 1 - b

  l += 1

print((min(B, l - B)))
S = eval(input())

L = [int(i) for i in S]

b = 1

B = 0

for i in L:

  if i != b:

    B += 1

  b = 1 - b

l = len(L)

print((min(B, l - B)))
S = eval(input())
b = 1
B = 0
l = 0
for i in S:
    if int(i) != b:
        B += 1
    b = 1 - b
    l += 1
print((min(B, l - B)))

S = eval(input())
L = [int(i) for i in S]
b = 1
B = 0
for i in L:
    if i != b:
        B += 1
    b = 1 - b
l = len(L)
print((min(B, l - B)))

+L = [int(i) for i in S] -l = 0 -for i in S: -    if int(i) != b: +for i in L: +    if i != b: -    l += 1 +l = len(L)