# 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 = S[::2].count("1") + S[1::2].count("0")

    b = len(S) - a

    print((min(a, b)))





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 = S[::2].count("1") + S[1::2].count("0")
    b = len(S) - a
    print((min(a, b)))


if __name__ == "__main__":
    main()

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