s = eval(input())

l = [int(x) for x in list(str(s))]



ans_a = 0

for i in range(len(s)):

	if i%2 ==0 and l[i] == 0:

		pass

	elif i%2==1 and l[i] ==1:

		pass

	else:

		ans_a += 1



ans_b = 0

for i in range(len(s)):

	if i%2 ==0 and l[i] == 1:

		pass

	elif i%2 ==1 and l[i] == 0:

		pass

	else:

		ans_b += 1

print((min(ans_b,ans_a)))
s = eval(input())



ans_a = 0

ans_b = 0

for i in range(len(s)):

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

		pass

	elif i%2 == 1 and s[i]=="1":

		pass

	else:

		ans_a += 1



for i in range(len(s)):

	if i%2 == 0 and s[i] =="1":

		pass

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

		pass

	else:

		ans_b += 1

print((min(ans_a, ans_b)))
s = eval(input())
l = [int(x) for x in list(str(s))]
ans_a = 0
for i in range(len(s)):
    if i % 2 == 0 and l[i] == 0:
        pass
    elif i % 2 == 1 and l[i] == 1:
        pass
    else:
        ans_a += 1
ans_b = 0
for i in range(len(s)):
    if i % 2 == 0 and l[i] == 1:
        pass
    elif i % 2 == 1 and l[i] == 0:
        pass
    else:
        ans_b += 1
print((min(ans_b, ans_a)))

s = eval(input())
ans_a = 0
ans_b = 0
for i in range(len(s)):
    if i % 2 == 0 and s[i] == "0":
        pass
    elif i % 2 == 1 and s[i] == "1":
        pass
    else:
        ans_a += 1
for i in range(len(s)):
    if i % 2 == 0 and s[i] == "1":
        pass
    elif i % 2 == 1 and s[i] == "0":
        pass
    else:
        ans_b += 1
print((min(ans_a, ans_b)))

-l = [int(x) for x in list(str(s))] +ans_b = 0 -    if i % 2 == 0 and l[i] == 0: +    if i % 2 == 0 and s[i] == "0": -    elif i % 2 == 1 and l[i] == 1: +    elif i % 2 == 1 and s[i] == "1": -ans_b = 0 -    if i % 2 == 0 and l[i] == 1: +    if i % 2 == 0 and s[i] == "1": -    elif i % 2 == 1 and l[i] == 0: +    elif i % 2 == 1 and s[i] == "0": -print((min(ans_b, ans_a))) +print((min(ans_a, ans_b)))