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



ideal1 = [0 for _ in range(len(s))]

for i in range(len(s)):

  if i % 2 == 0:

    ideal1[i] = 1

  else:

    ideal1[i] = 0



ideal2 = [0 for _ in range(len(s))]

for i in range(len(s)):

  if i % 2 == 0:

    ideal2[i] = 0

  else:

    ideal2[i] = 1



count1 = 0

count2 = 0



for i in range(len(s)):

  if s[i] != ideal1[i]:

    count1 += 1

  elif s[i] != ideal2[i]:

    count2 += 1



print((min(count1, count2)))



S = list(eval(input()))

ans1 = 0

ans2 = 0

# 10101010...

for i in range(len(S)):

  if i % 2 == 0:

    if S[i] == '0':

      ans1 += 1

  if i % 2 != 0:

    if S[i] == '1':

      ans1 += 1



# 01010101...

for i in range(len(S)):

  if i % 2 == 0:

    if S[i] == '1':

      ans2 += 1

  if i % 2 != 0:

    if S[i] == '0':

      ans2 += 1

print((min(ans1, ans2)))
s = list(map(int, eval(input())))
ideal1 = [0 for _ in range(len(s))]
for i in range(len(s)):
    if i % 2 == 0:
        ideal1[i] = 1
    else:
        ideal1[i] = 0
ideal2 = [0 for _ in range(len(s))]
for i in range(len(s)):
    if i % 2 == 0:
        ideal2[i] = 0
    else:
        ideal2[i] = 1
count1 = 0
count2 = 0
for i in range(len(s)):
    if s[i] != ideal1[i]:
        count1 += 1
    elif s[i] != ideal2[i]:
        count2 += 1
print((min(count1, count2)))

S = list(eval(input()))
ans1 = 0
ans2 = 0
# 10101010...
for i in range(len(S)):
    if i % 2 == 0:
        if S[i] == "0":
            ans1 += 1
    if i % 2 != 0:
        if S[i] == "1":
            ans1 += 1
# 01010101...
for i in range(len(S)):
    if i % 2 == 0:
        if S[i] == "1":
            ans2 += 1
    if i % 2 != 0:
        if S[i] == "0":
            ans2 += 1
print((min(ans1, ans2)))

-s = list(map(int, eval(input()))) -ideal1 = [0 for _ in range(len(s))] -for i in range(len(s)): +S = list(eval(input())) +ans1 = 0 +ans2 = 0 +# 10101010... +for i in range(len(S)): -        ideal1[i] = 1 -    else: -        ideal1[i] = 0 -ideal2 = [0 for _ in range(len(s))] -for i in range(len(s)): +        if S[i] == "0": +            ans1 += 1 +    if i % 2 != 0: +        if S[i] == "1": +            ans1 += 1 +# 01010101... +for i in range(len(S)): -        ideal2[i] = 0 -    else: -        ideal2[i] = 1 -count1 = 0 -count2 = 0 -for i in range(len(s)): -    if s[i] != ideal1[i]: -        count1 += 1 -    elif s[i] != ideal2[i]: -        count2 += 1 -print((min(count1, count2))) +        if S[i] == "1": +            ans2 += 1 +    if i % 2 != 0: +        if S[i] == "0": +            ans2 += 1 +print((min(ans1, ans2)))