def main():

    S = [int(i) for i in eval(input())]

    x = - (-len(S) // 2) - sum(S[::2]) + sum(S[1::2])

    print((min(x, len(S) - x)))



    return





main()

def repaint(S):

    return S[::2].count("0") + S[1::2].count("1")





def main():

    S = eval(input())

    print((min(repaint(S), len(S) - repaint(S))))



    return





main()

def main():
    S = [int(i) for i in eval(input())]
    x = -(-len(S) // 2) - sum(S[::2]) + sum(S[1::2])
    print((min(x, len(S) - x)))
    return


main()

def repaint(S):
    return S[::2].count("0") + S[1::2].count("1")


def main():
    S = eval(input())
    print((min(repaint(S), len(S) - repaint(S))))
    return


main()

+def repaint(S): +    return S[::2].count("0") + S[1::2].count("1") + + -    S = [int(i) for i in eval(input())] -    x = -(-len(S) // 2) - sum(S[::2]) + sum(S[1::2]) -    print((min(x, len(S) - x))) +    S = eval(input()) +    print((min(repaint(S), len(S) - repaint(S))))