from itertools import zip_longest



S = eval(input())

ans = 0



for curr, next in list(zip_longest(S, S[1:]))[::2]:

  if curr == '0': ans += 1

  if next == '1': ans += 1



print((min(ans, len(S) - ans)))
from itertools import zip_longest, islice



S = eval(input())

ans = 0



for curr, next in islice(zip_longest(S, S[1:]), 0, None, 2):

  if curr == '0': ans += 1

  if next == '1': ans += 1



print((min(ans, len(S) - ans)))
from itertools import zip_longest

S = eval(input())
ans = 0
for curr, next in list(zip_longest(S, S[1:]))[::2]:
    if curr == "0":
        ans += 1
    if next == "1":
        ans += 1
print((min(ans, len(S) - ans)))

from itertools import zip_longest, islice

S = eval(input())
ans = 0
for curr, next in islice(zip_longest(S, S[1:]), 0, None, 2):
    if curr == "0":
        ans += 1
    if next == "1":
        ans += 1
print((min(ans, len(S) - ans)))

-from itertools import zip_longest +from itertools import zip_longest, islice -for curr, next in list(zip_longest(S, S[1:]))[::2]: +for curr, next in islice(zip_longest(S, S[1:]), 0, None, 2):