import numpy as np

#input

S = str(eval(input()))

ans = 0

for i in range(len(S)):

    if i % 2 == 0:

        if S[i] == "1":

            ans += 1

    else:

        if S[i] == "0":

            ans += 1

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


#input

#N = list(map(int,input().split()))

#H = list(map(int,input().split()))

S = str(eval(input()))

ans = 0

for i in range(len(S)):

    if i % 2 == 0:

        if S[i] == "1":

            ans += 1

    else:

        if S[i] == "0":

            ans+= 1

print((min(ans,len(S)-ans)))
import numpy as np

# input
S = str(eval(input()))
ans = 0
for i in range(len(S)):
    if i % 2 == 0:
        if S[i] == "1":
            ans += 1
    else:
        if S[i] == "0":
            ans += 1
print((min(ans, len(S) - ans)))

# input
# N = list(map(int,input().split()))
# H = list(map(int,input().split()))
S = str(eval(input()))
ans = 0
for i in range(len(S)):
    if i % 2 == 0:
        if S[i] == "1":
            ans += 1
    else:
        if S[i] == "0":
            ans += 1
print((min(ans, len(S) - ans)))

-import numpy as np - +# N = list(map(int,input().split())) +# H = list(map(int,input().split()))