s = eval(input())

N = len(s)

left_white=[]

for i in range(N):

    if (i%2) == 0:

        left_white.append(1)

    else:

        left_white.append(0)

left_black=[]

for i in range(N):

    if (i%2) == 0:

        left_black.append(0)

    else:

        left_black.append(1)

count_w = 0

for i in range(N):

    if int(s[i]) != left_white[i]:

        count_w = count_w+1

count_b = 0

for i in range(N):

    if int(s[i]) != left_black[i]:

        count_b += 1

print((min(count_w,count_b)))
s = eval(input())

N = len(s)

count_w = 0

for i in range(N):

    if ((i%2) == 0 and int(s[i]) == 0) or ((i%2) == 1 and int(s[i]) == 1):

        count_w += 1

count_b = 0

for i in range(N):

    if ((i%2) == 0 and int(s[i]) == 1) or ((i%2) == 1 and int(s[i]) == 0):

        count_b += 1

print((min(count_b,count_w)))
s = eval(input())
N = len(s)
left_white = []
for i in range(N):
    if (i % 2) == 0:
        left_white.append(1)
    else:
        left_white.append(0)
left_black = []
for i in range(N):
    if (i % 2) == 0:
        left_black.append(0)
    else:
        left_black.append(1)
count_w = 0
for i in range(N):
    if int(s[i]) != left_white[i]:
        count_w = count_w + 1
count_b = 0
for i in range(N):
    if int(s[i]) != left_black[i]:
        count_b += 1
print((min(count_w, count_b)))

s = eval(input())
N = len(s)
count_w = 0
for i in range(N):
    if ((i % 2) == 0 and int(s[i]) == 0) or ((i % 2) == 1 and int(s[i]) == 1):
        count_w += 1
count_b = 0
for i in range(N):
    if ((i % 2) == 0 and int(s[i]) == 1) or ((i % 2) == 1 and int(s[i]) == 0):
        count_b += 1
print((min(count_b, count_w)))

-left_white = [] -for i in range(N): -    if (i % 2) == 0: -        left_white.append(1) -    else: -        left_white.append(0) -left_black = [] -for i in range(N): -    if (i % 2) == 0: -        left_black.append(0) -    else: -        left_black.append(1) -    if int(s[i]) != left_white[i]: -        count_w = count_w + 1 +    if ((i % 2) == 0 and int(s[i]) == 0) or ((i % 2) == 1 and int(s[i]) == 1): +        count_w += 1 -    if int(s[i]) != left_black[i]: +    if ((i % 2) == 0 and int(s[i]) == 1) or ((i % 2) == 1 and int(s[i]) == 0): -print((min(count_w, count_b))) +print((min(count_b, count_w)))