# ABC124C - Coloring Colorfully

def main():

    s = eval(input())

    a, ans = s[0], 0

    for i, j in enumerate(s):

        if (i % 2 and j == a) or (not i % 2 and j != a):

            ans += 1

    print(ans)





if __name__ == "__main__":

    main()
# ABC124C - Coloring Colorfully

def main():

    S = eval(input())

    a = sum(i != "1" for i in S[::2]) + sum(i != "0" for i in S[1::2])

    b = len(S) - a

    print((min(a, b)))





if __name__ == "__main__":

    main()
# ABC124C - Coloring Colorfully
def main():
    s = eval(input())
    a, ans = s[0], 0
    for i, j in enumerate(s):
        if (i % 2 and j == a) or (not i % 2 and j != a):
            ans += 1
    print(ans)


if __name__ == "__main__":
    main()

# ABC124C - Coloring Colorfully
def main():
    S = eval(input())
    a = sum(i != "1" for i in S[::2]) + sum(i != "0" for i in S[1::2])
    b = len(S) - a
    print((min(a, b)))


if __name__ == "__main__":
    main()

-    s = eval(input()) -    a, ans = s[0], 0 -    for i, j in enumerate(s): -        if (i % 2 and j == a) or (not i % 2 and j != a): -            ans += 1 -    print(ans) +    S = eval(input()) +    a = sum(i != "1" for i in S[::2]) + sum(i != "0" for i in S[1::2]) +    b = len(S) - a +    print((min(a, b)))