S = eval(input())



if not S[:-1]:

    print((0))

else:



  out1 = out2 = 0

  for i, j in enumerate(S):

    xor = (j == '1') ^ (i % 2)

    out1 += xor



  print((out1 if out1 < (i + 1) - out1 else (i + 1) - out1))
s = eval(input())

if len(s) == 1:

    print((0))

else:

    r = 0

    f = s[0]

    for i in s[1:]:

        if i == f:

            r += 1

            f = '1' if i == '0' else '0'

        else:

        	f = i

    print(r)
S = eval(input())
if not S[:-1]:
    print((0))
else:
    out1 = out2 = 0
    for i, j in enumerate(S):
        xor = (j == "1") ^ (i % 2)
        out1 += xor
    print((out1 if out1 < (i + 1) - out1 else (i + 1) - out1))

s = eval(input())
if len(s) == 1:
    print((0))
else:
    r = 0
    f = s[0]
    for i in s[1:]:
        if i == f:
            r += 1
            f = "1" if i == "0" else "0"
        else:
            f = i
    print(r)

-S = eval(input()) -if not S[:-1]: +s = eval(input()) +if len(s) == 1: -    out1 = out2 = 0 -    for i, j in enumerate(S): -        xor = (j == "1") ^ (i % 2) -        out1 += xor -    print((out1 if out1 < (i + 1) - out1 else (i + 1) - out1)) +    r = 0 +    f = s[0] +    for i in s[1:]: +        if i == f: +            r += 1 +            f = "1" if i == "0" else "0" +        else: +            f = i +    print(r)