import sys

import os



ii = lambda: int(sys.stdin.buffer.readline().rstrip())

il = lambda: list(map(int, sys.stdin.buffer.readline().split()))

fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))

iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]



iss = lambda: sys.stdin.buffer.readline().decode().rstrip()

sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))

isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]



MOD = 10 ** 9 + 7





def func(q, S):

    ret = 0

    for s in S:

        if q == s:

            ret += 1

        q = '1' if q == '0' else '0'

    return ret





def main():

    if os.getenv("LOCAL"):

        sys.stdin = open("input.txt", "r")



    S = list(iss())

    print((min(func('0', S), func('1', S))))





if __name__ == '__main__':

    main()

import sys

import os



ii = lambda: int(sys.stdin.buffer.readline().rstrip())

il = lambda: list(map(int, sys.stdin.buffer.readline().split()))

fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))

iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]



iss = lambda: sys.stdin.buffer.readline().decode().rstrip()

sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))

isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]



MOD = 10 ** 9 + 7





def main():

    if os.getenv("LOCAL"):

        sys.stdin = open("input.txt", "r")



    S = list(iss())

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

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





if __name__ == '__main__':

    main()

import sys
import os

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]
iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]
MOD = 10**9 + 7


def func(q, S):
    ret = 0
    for s in S:
        if q == s:
            ret += 1
        q = "1" if q == "0" else "0"
    return ret


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")
    S = list(iss())
    print((min(func("0", S), func("1", S))))


if __name__ == "__main__":
    main()

import sys
import os

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]
iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]
MOD = 10**9 + 7


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")
    S = list(iss())
    t = S[::2].count("0") + S[1::2].count("1")
    print((min(t, len(S) - t)))


if __name__ == "__main__":
    main()

-def func(q, S): -    ret = 0 -    for s in S: -        if q == s: -            ret += 1 -        q = "1" if q == "0" else "0" -    return ret - - -    print((min(func("0", S), func("1", S)))) +    t = S[::2].count("0") + S[1::2].count("1") +    print((min(t, len(S) - t)))