S = list(map(int, list(eval(input()))))

colors = [0, 1]

cnt_b, cnt_w = 0, 0

b_list = [colors[i % 2] for i in range(len(S))]



for i in range(len(S)):

    if S[i] == b_list[i]:

        cnt_w += 1

    else:

        cnt_b += 1

        

print((min([cnt_w, cnt_b])))
def main():

    S = list(map(int, list(eval(input()))))

    cnt1, cnt2 = 0, 0

    for i, s in enumerate(S):

        if i % 2 == 0:

            if s:

                cnt1 += 1

            else:

                cnt2 += 1

        else:

            if s:

                cnt2 += 1

            else:

                cnt1 += 1

    print((min(cnt1, cnt2)))





if __name__ == '__main__':

    main()
S = list(map(int, list(eval(input()))))
colors = [0, 1]
cnt_b, cnt_w = 0, 0
b_list = [colors[i % 2] for i in range(len(S))]
for i in range(len(S)):
    if S[i] == b_list[i]:
        cnt_w += 1
    else:
        cnt_b += 1
print((min([cnt_w, cnt_b])))

def main():
    S = list(map(int, list(eval(input()))))
    cnt1, cnt2 = 0, 0
    for i, s in enumerate(S):
        if i % 2 == 0:
            if s:
                cnt1 += 1
            else:
                cnt2 += 1
        else:
            if s:
                cnt2 += 1
            else:
                cnt1 += 1
    print((min(cnt1, cnt2)))


if __name__ == "__main__":
    main()

-S = list(map(int, list(eval(input())))) -colors = [0, 1] -cnt_b, cnt_w = 0, 0 -b_list = [colors[i % 2] for i in range(len(S))] -for i in range(len(S)): -    if S[i] == b_list[i]: -        cnt_w += 1 -    else: -        cnt_b += 1 -print((min([cnt_w, cnt_b]))) +def main(): +    S = list(map(int, list(eval(input())))) +    cnt1, cnt2 = 0, 0 +    for i, s in enumerate(S): +        if i % 2 == 0: +            if s: +                cnt1 += 1 +            else: +                cnt2 += 1 +        else: +            if s: +                cnt2 += 1 +            else: +                cnt1 += 1 +    print((min(cnt1, cnt2))) + + +if __name__ == "__main__": +    main()