s=eval(input())

a=[]

b=[]

for i in range(len(s)):

    if i%2==0:

        a.append('0')

    else:

        a.append('1')

for j in range(len(s)):

    if j%2==1:

        b.append('0')

    else:

        b.append('1')

ans1=0

ans2=0

for k in range(len(a)):

    if a[k]!=s[k]:

        ans1+=1

for z in range(len(b)):

    if b[z]!=s[z]:

        ans2+=1

print((min(ans1,ans2)))
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 = eval(input())
a = []
b = []
for i in range(len(s)):
    if i % 2 == 0:
        a.append("0")
    else:
        a.append("1")
for j in range(len(s)):
    if j % 2 == 1:
        b.append("0")
    else:
        b.append("1")
ans1 = 0
ans2 = 0
for k in range(len(a)):
    if a[k] != s[k]:
        ans1 += 1
for z in range(len(b)):
    if b[z] != s[z]:
        ans2 += 1
print((min(ans1, ans2)))

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 = eval(input()) -a = [] -b = [] -for i in range(len(s)): -    if i % 2 == 0: -        a.append("0") -    else: -        a.append("1") -for j in range(len(s)): -    if j % 2 == 1: -        b.append("0") -    else: -        b.append("1") -ans1 = 0 -ans2 = 0 -for k in range(len(a)): -    if a[k] != s[k]: -        ans1 += 1 -for z in range(len(b)): -    if b[z] != s[z]: -        ans2 += 1 -print((min(ans1, ans2))) +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])))