s=list(eval(input()))

s1=[]

s2=[]



for i in range(len(s)):

    if i%2==0:

        s1.append('0')

        s2.append('1')

    else:

        s1.append('1')

        s2.append('0')

    

count1=0

count2=0

for i in range(len(s)):

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

        count1+=1

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

        count2+=1

        

print((min(count1,count2)))
s=eval(input())

count1=0

count2=0

for i,j in enumerate(s):

    if i%2==0:

        if j=='0':

            count1+=1

    else:

        if j=='1':

            count1+=1

    

for i,j in enumerate(s):

    if i%2==0:

        if j=='1':

            count2+=1

    else:

        if j=='0':

            count2+=1

print((min(count1,count2)))
s = list(eval(input()))
s1 = []
s2 = []
for i in range(len(s)):
    if i % 2 == 0:
        s1.append("0")
        s2.append("1")
    else:
        s1.append("1")
        s2.append("0")
count1 = 0
count2 = 0
for i in range(len(s)):
    if s[i] != s1[i]:
        count1 += 1
    if s[i] != s2[i]:
        count2 += 1
print((min(count1, count2)))

s = eval(input())
count1 = 0
count2 = 0
for i, j in enumerate(s):
    if i % 2 == 0:
        if j == "0":
            count1 += 1
    else:
        if j == "1":
            count1 += 1
for i, j in enumerate(s):
    if i % 2 == 0:
        if j == "1":
            count2 += 1
    else:
        if j == "0":
            count2 += 1
print((min(count1, count2)))

-s = list(eval(input())) -s1 = [] -s2 = [] -for i in range(len(s)): -    if i % 2 == 0: -        s1.append("0") -        s2.append("1") -    else: -        s1.append("1") -        s2.append("0") +s = eval(input()) -for i in range(len(s)): -    if s[i] != s1[i]: -        count1 += 1 -    if s[i] != s2[i]: -        count2 += 1 +for i, j in enumerate(s): +    if i % 2 == 0: +        if j == "0": +            count1 += 1 +    else: +        if j == "1": +            count1 += 1 +for i, j in enumerate(s): +    if i % 2 == 0: +        if j == "1": +            count2 += 1 +    else: +        if j == "0": +            count2 += 1