import numpy as np



S = list(int(x) for x in eval(input()))



L1 = np.array([0 if x % 2 == 0 else 1 for x in range(len(S))] )

L2 = np.array([1 if x % 2 == 0 else 0 for x in range(len(S))])



print((min(sum(np.logical_xor(S, L2)), sum(np.logical_xor(S, L1)))))
# coding: utf-8

import sys



sr = lambda: sys.stdin.readline().rstrip()

ir = lambda: int(sr())

lr = lambda: list(map(int, sr().split()))



S = list(map(int, list(sr())))

count = 0

for i in range(len(S)-1):

    if S[i] == S[i+1]:

        S[i+1] = 1 - S[i+1]

        count += 1



answer = min(count, len(S) - count)

print(answer)

import numpy as np

S = list(int(x) for x in eval(input()))
L1 = np.array([0 if x % 2 == 0 else 1 for x in range(len(S))])
L2 = np.array([1 if x % 2 == 0 else 0 for x in range(len(S))])
print((min(sum(np.logical_xor(S, L2)), sum(np.logical_xor(S, L1)))))

# coding: utf-8
import sys

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))
S = list(map(int, list(sr())))
count = 0
for i in range(len(S) - 1):
    if S[i] == S[i + 1]:
        S[i + 1] = 1 - S[i + 1]
        count += 1
answer = min(count, len(S) - count)
print(answer)

-import numpy as np +# coding: utf-8 +import sys -S = list(int(x) for x in eval(input())) -L1 = np.array([0 if x % 2 == 0 else 1 for x in range(len(S))]) -L2 = np.array([1 if x % 2 == 0 else 0 for x in range(len(S))]) -print((min(sum(np.logical_xor(S, L2)), sum(np.logical_xor(S, L1))))) +sr = lambda: sys.stdin.readline().rstrip() +ir = lambda: int(sr()) +lr = lambda: list(map(int, sr().split())) +S = list(map(int, list(sr()))) +count = 0 +for i in range(len(S) - 1): +    if S[i] == S[i + 1]: +        S[i + 1] = 1 - S[i + 1] +        count += 1 +answer = min(count, len(S) - count) +print(answer)