S = eval(input())

C = ["0","1"] 

count1=count2=0



for i in range(len(S)):

  # case 1

  if S[i] == C[i%2]:

    count1+=1

  # case 2

  if S[i] == C[(i+1)%2]:

    count2+=1



print((min([count1, count2])))

s = list(str(eval(input())))

n = len(s)

cnt = 0

for i in range(n):

    if (i % 2) != int(s[i]):

        cnt += 1

print((min(cnt, n - cnt)))

S = eval(input())
C = ["0", "1"]
count1 = count2 = 0
for i in range(len(S)):
    # case 1
    if S[i] == C[i % 2]:
        count1 += 1
    # case 2
    if S[i] == C[(i + 1) % 2]:
        count2 += 1
print((min([count1, count2])))

s = list(str(eval(input())))
n = len(s)
cnt = 0
for i in range(n):
    if (i % 2) != int(s[i]):
        cnt += 1
print((min(cnt, n - cnt)))

-S = eval(input()) -C = ["0", "1"] -count1 = count2 = 0 -for i in range(len(S)): -    # case 1 -    if S[i] == C[i % 2]: -        count1 += 1 -    # case 2 -    if S[i] == C[(i + 1) % 2]: -        count2 += 1 -print((min([count1, count2]))) +s = list(str(eval(input()))) +n = len(s) +cnt = 0 +for i in range(n): +    if (i % 2) != int(s[i]): +        cnt += 1 +print((min(cnt, n - cnt)))