S = eval(input())





#偶数を0,奇数を1にする場合

count01 = 0

for i in range(len(S)):

  if i%2 == 0:#偶数番目のとき

    if S[i] != "0":

      count01 += 1

  else:

    if S[i] != "1":

      count01 += 1

#偶数を1,奇数を0にする場合

count10 = 0

for i in range(len(S)):

  if i%2 == 0:#偶数番目のとき

    if S[i] != "1":

      count10 += 1

  else:

    if S[i] != "0":

      count10 += 1

      

print((min(count01,count10)))
S = eval(input())

a, b = 0, 0



for i in range(0,len(S),2):

  if S[i] == "0":

    a += 1

  else:

    b += 1

for i in range(1,len(S),2):

  if S[i] == "1":

    a += 1

  else:

    b += 1

print((min(a, b)))
S = eval(input())
# 偶数を0,奇数を1にする場合
count01 = 0
for i in range(len(S)):
    if i % 2 == 0:  # 偶数番目のとき
        if S[i] != "0":
            count01 += 1
    else:
        if S[i] != "1":
            count01 += 1
# 偶数を1,奇数を0にする場合
count10 = 0
for i in range(len(S)):
    if i % 2 == 0:  # 偶数番目のとき
        if S[i] != "1":
            count10 += 1
    else:
        if S[i] != "0":
            count10 += 1
print((min(count01, count10)))

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

-# 偶数を0,奇数を1にする場合 -count01 = 0 -for i in range(len(S)): -    if i % 2 == 0:  # 偶数番目のとき -        if S[i] != "0": -            count01 += 1 +a, b = 0, 0 +for i in range(0, len(S), 2): +    if S[i] == "0": +        a += 1 -        if S[i] != "1": -            count01 += 1 -# 偶数を1,奇数を0にする場合 -count10 = 0 -for i in range(len(S)): -    if i % 2 == 0:  # 偶数番目のとき -        if S[i] != "1": -            count10 += 1 +        b += 1 +for i in range(1, len(S), 2): +    if S[i] == "1": +        a += 1 -        if S[i] != "0": -            count10 += 1 -print((min(count01, count10))) +        b += 1 +print((min(a, b)))