S = eval(input())



count_0 = 0

count_1 = 0



for i,s in enumerate(S):

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

        count_1 += 1

    elif s=="1" and i%2==0:

        count_0 += 1



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

        count_1 += 1

    elif s=="0" and i%2==1:

        count_0 += 1



print((min(count_0,count_1)))

S = eval(input())



count_0 = 0

count_1 = 0



for i,s in enumerate(S):

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

        count_1 += 1

        continue

    elif s=="1" and i%2==0:

        count_0 += 1

        continue

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

        count_1 += 1

    elif s=="0" and i%2==1:

        count_0 += 1



print((min(count_0,count_1)))

S = eval(input())
count_0 = 0
count_1 = 0
for i, s in enumerate(S):
    if s == "0" and i % 2 == 0:
        count_1 += 1
    elif s == "1" and i % 2 == 0:
        count_0 += 1
    if s == "1" and i % 2 == 1:
        count_1 += 1
    elif s == "0" and i % 2 == 1:
        count_0 += 1
print((min(count_0, count_1)))

S = eval(input())
count_0 = 0
count_1 = 0
for i, s in enumerate(S):
    if s == "0" and i % 2 == 0:
        count_1 += 1
        continue
    elif s == "1" and i % 2 == 0:
        count_0 += 1
        continue
    if s == "1" and i % 2 == 1:
        count_1 += 1
    elif s == "0" and i % 2 == 1:
        count_0 += 1
print((min(count_0, count_1)))

+        continue +        continue