import sys



def i2s():

    return sys.stdin.readline()



def ii2ss(n):

    return [sys.stdin.readline() for _ in range(n)]



def sp2nn(sp, sep=' '):

    return [int(s) for s in sp.split(sep)]



def ss2nn(ss):

    return [int(s) for s in list(ss)]



def main(S):

    S = S.rstrip()

    c0 = 0

    c1 = 0

    for i, s in enumerate(S):

        if (i % 2) == int(s):

            c0 += 1

        else:

            c1 += 1

    cmin = min(c0, c1)

    print(cmin)



main(i2s())
# AtCoder Beginner Contest 124

# https://atcoder.jp/contests/abc124

import sys



s2nn = lambda s: [int(c) for c in s.split(' ')]

ss2nn = lambda ss: [int(s) for s in list(ss)]

ss2nnn = lambda ss: [s2nn(s) for s in list(ss)]

i2s = lambda: sys.stdin.readline().rstrip()

i2n = lambda: int(i2s())

i2nn = lambda: s2nn(i2s())

ii2ss = lambda n: [sys.stdin.readline() for _ in range(n)]

ii2nnn = lambda n: ss2nnn(ii2ss(n))



def main(S):

    n1 = 0

    n2 = 0

    for i in range(len(S)):

        if i % 2 == 0:

            if S[i] == '0':

                n1 += 1

            else:

                n2 += 1

        if i % 2 == 1:

            if S[i] == '1':

                n1 += 1

            else:

                n2 += 1

    n = min(n1, n2)

    print(n)



S = i2s()

main(S)

import sys


def i2s():
    return sys.stdin.readline()


def ii2ss(n):
    return [sys.stdin.readline() for _ in range(n)]


def sp2nn(sp, sep=" "):
    return [int(s) for s in sp.split(sep)]


def ss2nn(ss):
    return [int(s) for s in list(ss)]


def main(S):
    S = S.rstrip()
    c0 = 0
    c1 = 0
    for i, s in enumerate(S):
        if (i % 2) == int(s):
            c0 += 1
        else:
            c1 += 1
    cmin = min(c0, c1)
    print(cmin)


main(i2s())

# AtCoder Beginner Contest 124
# https://atcoder.jp/contests/abc124
import sys

s2nn = lambda s: [int(c) for c in s.split(" ")]
ss2nn = lambda ss: [int(s) for s in list(ss)]
ss2nnn = lambda ss: [s2nn(s) for s in list(ss)]
i2s = lambda: sys.stdin.readline().rstrip()
i2n = lambda: int(i2s())
i2nn = lambda: s2nn(i2s())
ii2ss = lambda n: [sys.stdin.readline() for _ in range(n)]
ii2nnn = lambda n: ss2nnn(ii2ss(n))


def main(S):
    n1 = 0
    n2 = 0
    for i in range(len(S)):
        if i % 2 == 0:
            if S[i] == "0":
                n1 += 1
            else:
                n2 += 1
        if i % 2 == 1:
            if S[i] == "1":
                n1 += 1
            else:
                n2 += 1
    n = min(n1, n2)
    print(n)


S = i2s()
main(S)

+# AtCoder Beginner Contest 124 +# https://atcoder.jp/contests/abc124 - -def i2s(): -    return sys.stdin.readline() - - -def ii2ss(n): -    return [sys.stdin.readline() for _ in range(n)] - - -def sp2nn(sp, sep=" "): -    return [int(s) for s in sp.split(sep)] - - -def ss2nn(ss): -    return [int(s) for s in list(ss)] +s2nn = lambda s: [int(c) for c in s.split(" ")] +ss2nn = lambda ss: [int(s) for s in list(ss)] +ss2nnn = lambda ss: [s2nn(s) for s in list(ss)] +i2s = lambda: sys.stdin.readline().rstrip() +i2n = lambda: int(i2s()) +i2nn = lambda: s2nn(i2s()) +ii2ss = lambda n: [sys.stdin.readline() for _ in range(n)] +ii2nnn = lambda n: ss2nnn(ii2ss(n)) -    S = S.rstrip() -    c0 = 0 -    c1 = 0 -    for i, s in enumerate(S): -        if (i % 2) == int(s): -            c0 += 1 -        else: -            c1 += 1 -    cmin = min(c0, c1) -    print(cmin) +    n1 = 0 +    n2 = 0 +    for i in range(len(S)): +        if i % 2 == 0: +            if S[i] == "0": +                n1 += 1 +            else: +                n2 += 1 +        if i % 2 == 1: +            if S[i] == "1": +                n1 += 1 +            else: +                n2 += 1 +    n = min(n1, n2) +    print(n) -main(i2s()) +S = i2s() +main(S)