inpl = eval(input())

c1 = 0

c2 = 0



for i in range(1,len(inpl)+1):

    if i % 2 != 0:

        if inpl[i-1] == '0':

            c1 += 1

    else:

        if inpl[i-1] == '1':

            c1 += 1



for i in range(1,len(inpl)+1):

    if i % 2 != 1:

        if inpl[i-1] == '0':

            c2 += 1

    else:

        if inpl[i-1] == '1':

            c2 += 1

print((c1 if c1 < c2 else c2))
inpl = eval(input())

c1 = 0

c2 = 0



for i,s in enumerate(inpl):

    if i % 2 != 0:

        if s == '0':

            c1 += 1

    else:

        if s == '1':

            c1 += 1



for i,s in enumerate(inpl):

    if i % 2 != 1:

        if s == '0':

            c2 += 1

    else:

        if s == '1':

            c2 += 1

print((c1 if c1 < c2 else c2))
inpl = eval(input())
c1 = 0
c2 = 0
for i in range(1, len(inpl) + 1):
    if i % 2 != 0:
        if inpl[i - 1] == "0":
            c1 += 1
    else:
        if inpl[i - 1] == "1":
            c1 += 1
for i in range(1, len(inpl) + 1):
    if i % 2 != 1:
        if inpl[i - 1] == "0":
            c2 += 1
    else:
        if inpl[i - 1] == "1":
            c2 += 1
print((c1 if c1 < c2 else c2))

inpl = eval(input())
c1 = 0
c2 = 0
for i, s in enumerate(inpl):
    if i % 2 != 0:
        if s == "0":
            c1 += 1
    else:
        if s == "1":
            c1 += 1
for i, s in enumerate(inpl):
    if i % 2 != 1:
        if s == "0":
            c2 += 1
    else:
        if s == "1":
            c2 += 1
print((c1 if c1 < c2 else c2))

-for i in range(1, len(inpl) + 1): +for i, s in enumerate(inpl): -        if inpl[i - 1] == "0": +        if s == "0": -        if inpl[i - 1] == "1": +        if s == "1": -for i in range(1, len(inpl) + 1): +for i, s in enumerate(inpl): -        if inpl[i - 1] == "0": +        if s == "0": -        if inpl[i - 1] == "1": +        if s == "1":