S = eval(input())

p01 = 0

p10 = 0

p00 = 0

p11 = 0

for i in range(0, (len(S)//2 * 2), 2):

    if S[i:i+2] == '01':

        p01 += 1

    elif S[i:i+2] == '10':

        p10 += 1

    elif S[i:i+2] == '00':

        p00 += 1

    else:

        p11 += 1

#print(p01,p10,p00,p11)

c = 0

if (p01 == 0) and (p10 == 0):

    c = len(S) // 2

elif p01 >= p10:

    c = p10 * 2 + p00 + p11

    if len(S) & 1:

        if S[-1] == S[-2]:

            c += 1

else:

    c = p01 * 2 + p00 + p11

    if len(S) & 1:

        if S[-1] == S[-2]:

            c += 1

print(c)
S = eval(input())

c = 0

zo = 0 # zero-one

oz = 0 # one-zero

for i in range(0, len(S)//2 * 2, 2):

    if S[i] == '0':

        oz += 1

    else:

        zo += 1

    if S[i+1] == '0':

        zo += 1

    else:

        oz += 1

if len(S) & 1:

    if S[-1] == '0':

        oz += 1

    else:

        zo += 1

print((min(oz, zo)))
S = eval(input())
p01 = 0
p10 = 0
p00 = 0
p11 = 0
for i in range(0, (len(S) // 2 * 2), 2):
    if S[i : i + 2] == "01":
        p01 += 1
    elif S[i : i + 2] == "10":
        p10 += 1
    elif S[i : i + 2] == "00":
        p00 += 1
    else:
        p11 += 1
# print(p01,p10,p00,p11)
c = 0
if (p01 == 0) and (p10 == 0):
    c = len(S) // 2
elif p01 >= p10:
    c = p10 * 2 + p00 + p11
    if len(S) & 1:
        if S[-1] == S[-2]:
            c += 1
else:
    c = p01 * 2 + p00 + p11
    if len(S) & 1:
        if S[-1] == S[-2]:
            c += 1
print(c)

S = eval(input())
c = 0
zo = 0  # zero-one
oz = 0  # one-zero
for i in range(0, len(S) // 2 * 2, 2):
    if S[i] == "0":
        oz += 1
    else:
        zo += 1
    if S[i + 1] == "0":
        zo += 1
    else:
        oz += 1
if len(S) & 1:
    if S[-1] == "0":
        oz += 1
    else:
        zo += 1
print((min(oz, zo)))

-p01 = 0 -p10 = 0 -p00 = 0 -p11 = 0 -for i in range(0, (len(S) // 2 * 2), 2): -    if S[i : i + 2] == "01": -        p01 += 1 -    elif S[i : i + 2] == "10": -        p10 += 1 -    elif S[i : i + 2] == "00": -        p00 += 1 +c = 0 +zo = 0  # zero-one +oz = 0  # one-zero +for i in range(0, len(S) // 2 * 2, 2): +    if S[i] == "0": +        oz += 1 -        p11 += 1 -# print(p01,p10,p00,p11) -c = 0 -if (p01 == 0) and (p10 == 0): -    c = len(S) // 2 -elif p01 >= p10: -    c = p10 * 2 + p00 + p11 -    if len(S) & 1: -        if S[-1] == S[-2]: -            c += 1 -else: -    c = p01 * 2 + p00 + p11 -    if len(S) & 1: -        if S[-1] == S[-2]: -            c += 1 -print(c) +        zo += 1 +    if S[i + 1] == "0": +        zo += 1 +    else: +        oz += 1 +if len(S) & 1: +    if S[-1] == "0": +        oz += 1 +    else: +        zo += 1 +print((min(oz, zo)))