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)))
result1 = 0

S = eval(input())

l = len(S)

for i in range(l):

  if i % 2 == 0:

    if S[i] == "0":

      result1 += 1

  else:

    if S[i] == "1":

      result1 += 1

print((min(result1,l - result1)))
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)))

result1 = 0
S = eval(input())
l = len(S)
for i in range(l):
    if i % 2 == 0:
        if S[i] == "0":
            result1 += 1
    else:
        if S[i] == "1":
            result1 += 1
print((min(result1, l - result1)))

+result1 = 0 -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 = len(S) +for i in range(l): +    if i % 2 == 0: +        if S[i] == "0": +            result1 += 1 +    else: +        if S[i] == "1": +            result1 += 1 +print((min(result1, l - result1)))