x=eval(input())

x=[i for i in x]

n=len(x)

y=['1']

a=0

b=0

for i in range(n-1):

    if i%2==0:

        y.append('0')

    else:

        y.append('1')

z=['0']

for i in range(n-1):

    if i%2==0:

        z.append('1')

    else:

        z.append('0')

for i in range(n):

    if x[i]!=y[i]:

        a+=1

    if x[i]!=z[i]:

        b+=1

print((min(a,b)))

colormap = eval(input(''))

colormaplist = [int(i) for i in colormap]

changecounter = 0

for i in range(len(colormaplist)-1):

    if colormaplist[i+1] == colormaplist[i]:

        colormaplist[i+1] = 1-colormaplist[i+1]

        changecounter+=1

print(changecounter)







x = eval(input())
x = [i for i in x]
n = len(x)
y = ["1"]
a = 0
b = 0
for i in range(n - 1):
    if i % 2 == 0:
        y.append("0")
    else:
        y.append("1")
z = ["0"]
for i in range(n - 1):
    if i % 2 == 0:
        z.append("1")
    else:
        z.append("0")
for i in range(n):
    if x[i] != y[i]:
        a += 1
    if x[i] != z[i]:
        b += 1
print((min(a, b)))

colormap = eval(input(""))
colormaplist = [int(i) for i in colormap]
changecounter = 0
for i in range(len(colormaplist) - 1):
    if colormaplist[i + 1] == colormaplist[i]:
        colormaplist[i + 1] = 1 - colormaplist[i + 1]
        changecounter += 1
print(changecounter)

-x = eval(input()) -x = [i for i in x] -n = len(x) -y = ["1"] -a = 0 -b = 0 -for i in range(n - 1): -    if i % 2 == 0: -        y.append("0") -    else: -        y.append("1") -z = ["0"] -for i in range(n - 1): -    if i % 2 == 0: -        z.append("1") -    else: -        z.append("0") -for i in range(n): -    if x[i] != y[i]: -        a += 1 -    if x[i] != z[i]: -        b += 1 -print((min(a, b))) +colormap = eval(input("")) +colormaplist = [int(i) for i in colormap] +changecounter = 0 +for i in range(len(colormaplist) - 1): +    if colormaplist[i + 1] == colormaplist[i]: +        colormaplist[i + 1] = 1 - colormaplist[i + 1] +        changecounter += 1 +print(changecounter)