a = eval(input())

b = [bool(int(a[i])) for i in range(len(a))]

b.insert(0, True)

c = [bool(int(a[i])) for i in range(len(a))]

c.insert(0, False)

bc = 0

cc = 0



for i in range(1, len(b)):

    if b[i-1] == b[i]:

        b[i] = not b[i-1]

        bc += 1

    if c[i-1] == c[i]:

        c[i] = not c[i - 1]

        cc += 1



print((min(bc, cc)))

a = eval(input())

a = [bool(int(a[i])) for i in range(len(a))]

b = True

c = 0

d = 0

for i in range(len(a)):

    if b is a[i]:

        c += 1

    if b is not a[i]:

        d += 1

    b = not b

print((min(c, d)))

a = eval(input())
b = [bool(int(a[i])) for i in range(len(a))]
b.insert(0, True)
c = [bool(int(a[i])) for i in range(len(a))]
c.insert(0, False)
bc = 0
cc = 0
for i in range(1, len(b)):
    if b[i - 1] == b[i]:
        b[i] = not b[i - 1]
        bc += 1
    if c[i - 1] == c[i]:
        c[i] = not c[i - 1]
        cc += 1
print((min(bc, cc)))

a = eval(input())
a = [bool(int(a[i])) for i in range(len(a))]
b = True
c = 0
d = 0
for i in range(len(a)):
    if b is a[i]:
        c += 1
    if b is not a[i]:
        d += 1
    b = not b
print((min(c, d)))

-b = [bool(int(a[i])) for i in range(len(a))] -b.insert(0, True) -c = [bool(int(a[i])) for i in range(len(a))] -c.insert(0, False) -bc = 0 -cc = 0 -for i in range(1, len(b)): -    if b[i - 1] == b[i]: -        b[i] = not b[i - 1] -        bc += 1 -    if c[i - 1] == c[i]: -        c[i] = not c[i - 1] -        cc += 1 -print((min(bc, cc))) +a = [bool(int(a[i])) for i in range(len(a))] +b = True +c = 0 +d = 0 +for i in range(len(a)): +    if b is a[i]: +        c += 1 +    if b is not a[i]: +        d += 1 +    b = not b +print((min(c, d)))