S = str(eval(input()))

s0=0

s1=0

for i in range(len(S)):

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

        s1+=1

    elif i%2==0 and S[i]=="1" :

        s0+=1

    elif i%2==1 and S[i]=="0":

        s0+=1



    elif i%2==1 and S[i]=="1":

        s1+=1



print((min(s0,s1)))
#C 

S =eval(input())

s0=0

s1=0

for i in range(len(S)):

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

        s1+=1

    elif i%2==0:

        s0+=1

    elif i%2!=0 and S[i]=="0":

        s0+=1

    elif i%2!=0:

        s1+=1

print((min(s0,s1)))
S = str(eval(input()))
s0 = 0
s1 = 0
for i in range(len(S)):
    if i % 2 == 0 and S[i] == "0":
        s1 += 1
    elif i % 2 == 0 and S[i] == "1":
        s0 += 1
    elif i % 2 == 1 and S[i] == "0":
        s0 += 1
    elif i % 2 == 1 and S[i] == "1":
        s1 += 1
print((min(s0, s1)))

# C
S = eval(input())
s0 = 0
s1 = 0
for i in range(len(S)):
    if i % 2 == 0 and S[i] == "0":
        s1 += 1
    elif i % 2 == 0:
        s0 += 1
    elif i % 2 != 0 and S[i] == "0":
        s0 += 1
    elif i % 2 != 0:
        s1 += 1
print((min(s0, s1)))

-S = str(eval(input())) +# C +S = eval(input()) -    elif i % 2 == 0 and S[i] == "1": +    elif i % 2 == 0: -    elif i % 2 == 1 and S[i] == "0": +    elif i % 2 != 0 and S[i] == "0": -    elif i % 2 == 1 and S[i] == "1": +    elif i % 2 != 0: