S = list(map(int, eval(input())))

ans1 = 0

ans2 = 0

for i in range (len(S)):

  if i % 2 == 0 and S[i] == 0:

      ans1 += 1

  elif i %2 ==1 and S[i] == 1:

      ans1 += 1

for i in range(len(S)):

  if i % 2 == 0 and S[i] == 1:

      ans2 += 1

  elif i % 2 ==1 and S[i] == 0:

      ans2 += 1

print((min(ans1, ans2)))



S = list(map(int, eval(input())))

ans1 = 0

ans2 = 0

for i in range (len(S)):

  if i % 2 == 0:

    if S[i] == 0:

      ans1 += 1

  else:

    if S[i] == 1:

      ans1 += 1

for i in range(len(S)):

  if i % 2 == 0:

    if S[i] == 1:

      ans2 += 1

  else:

    if S[i] == 0:

      ans2 += 1

print((min(ans1, ans2)))
S = list(map(int, eval(input())))
ans1 = 0
ans2 = 0
for i in range(len(S)):
    if i % 2 == 0 and S[i] == 0:
        ans1 += 1
    elif i % 2 == 1 and S[i] == 1:
        ans1 += 1
for i in range(len(S)):
    if i % 2 == 0 and S[i] == 1:
        ans2 += 1
    elif i % 2 == 1 and S[i] == 0:
        ans2 += 1
print((min(ans1, ans2)))

S = list(map(int, eval(input())))
ans1 = 0
ans2 = 0
for i in range(len(S)):
    if i % 2 == 0:
        if S[i] == 0:
            ans1 += 1
    else:
        if S[i] == 1:
            ans1 += 1
for i in range(len(S)):
    if i % 2 == 0:
        if S[i] == 1:
            ans2 += 1
    else:
        if S[i] == 0:
            ans2 += 1
print((min(ans1, ans2)))

-    if i % 2 == 0 and S[i] == 0: -        ans1 += 1 -    elif i % 2 == 1 and S[i] == 1: -        ans1 += 1 +    if i % 2 == 0: +        if S[i] == 0: +            ans1 += 1 +    else: +        if S[i] == 1: +            ans1 += 1 -    if i % 2 == 0 and S[i] == 1: -        ans2 += 1 -    elif i % 2 == 1 and S[i] == 0: -        ans2 += 1 +    if i % 2 == 0: +        if S[i] == 1: +            ans2 += 1 +    else: +        if S[i] == 0: +            ans2 += 1