s=eval(input())

N=len(s)

A=0

B=0

for i in range(0,N,2):

    if s[i]=='0':

        A+=1

    if i+1==N:

        break

    if s[i+1]=='1':

        B+=1

if A+B<=N/2:

    print((A+B))

else:

    print((N-(A+B)))

s=eval(input())

ptn1=s[::2].count('0')+s[1::2].count('1')

ptn2=s[::2].count('1')+s[1::2].count('0')

print((min(ptn1,ptn2)))

s = eval(input())
N = len(s)
A = 0
B = 0
for i in range(0, N, 2):
    if s[i] == "0":
        A += 1
    if i + 1 == N:
        break
    if s[i + 1] == "1":
        B += 1
if A + B <= N / 2:
    print((A + B))
else:
    print((N - (A + B)))

s = eval(input())
ptn1 = s[::2].count("0") + s[1::2].count("1")
ptn2 = s[::2].count("1") + s[1::2].count("0")
print((min(ptn1, ptn2)))

-N = len(s) -A = 0 -B = 0 -for i in range(0, N, 2): -    if s[i] == "0": -        A += 1 -    if i + 1 == N: -        break -    if s[i + 1] == "1": -        B += 1 -if A + B <= N / 2: -    print((A + B)) -else: -    print((N - (A + B))) +ptn1 = s[::2].count("0") + s[1::2].count("1") +ptn2 = s[::2].count("1") + s[1::2].count("0") +print((min(ptn1, ptn2)))