s = eval(input())



ans1 = 0

ans2 = 0



for i in range(len(s)):

  if i%2==0 and s[i]=="0":

    ans1 += 1

  if i%2==1 and s[i]=="1":

    ans1 += 1

  if i%2==0 and s[i]=="1":

    ans2 += 1

  if i%2==1 and s[i]=="0":

    ans2 += 1



print((min(ans1, ans2)))
s = eval(input())

ans1, ans2 = 0, 0

for i, e in enumerate(s):

  if i%2:

    if e=="0":

      ans1 += 1

    if e=="1":

      ans2 += 1

  else:

    if e=="1":

      ans1 += 1

    if e=="0":

      ans2 += 1

print((min(ans1, ans2)))
s = eval(input())
ans1 = 0
ans2 = 0
for i in range(len(s)):
    if i % 2 == 0 and s[i] == "0":
        ans1 += 1
    if i % 2 == 1 and s[i] == "1":
        ans1 += 1
    if i % 2 == 0 and s[i] == "1":
        ans2 += 1
    if i % 2 == 1 and s[i] == "0":
        ans2 += 1
print((min(ans1, ans2)))

s = eval(input())
ans1, ans2 = 0, 0
for i, e in enumerate(s):
    if i % 2:
        if e == "0":
            ans1 += 1
        if e == "1":
            ans2 += 1
    else:
        if e == "1":
            ans1 += 1
        if e == "0":
            ans2 += 1
print((min(ans1, ans2)))

-ans1 = 0 -ans2 = 0 -for i in range(len(s)): -    if i % 2 == 0 and s[i] == "0": -        ans1 += 1 -    if i % 2 == 1 and s[i] == "1": -        ans1 += 1 -    if i % 2 == 0 and s[i] == "1": -        ans2 += 1 -    if i % 2 == 1 and s[i] == "0": -        ans2 += 1 +ans1, ans2 = 0, 0 +for i, e in enumerate(s): +    if i % 2: +        if e == "0": +            ans1 += 1 +        if e == "1": +            ans2 += 1 +    else: +        if e == "1": +            ans1 += 1 +        if e == "0": +            ans2 += 1