s = list(eval(input()))



ans = 0

for i in range(1, len(s)):

    if s[i-1] == s[i]:

        ans += 1

        s[i] = "1" if s[i-1] == "0" else "0"



print(ans)

import collections

s = list(eval(input()))



even = collections.Counter(s[0::2])

odd = collections.Counter(s[1::2])



print((min(len(s) - (even["0"] + odd["1"]), len(s) - (even["1"] + odd["0"]))))

s = list(eval(input()))
ans = 0
for i in range(1, len(s)):
    if s[i - 1] == s[i]:
        ans += 1
        s[i] = "1" if s[i - 1] == "0" else "0"
print(ans)

import collections

s = list(eval(input()))
even = collections.Counter(s[0::2])
odd = collections.Counter(s[1::2])
print((min(len(s) - (even["0"] + odd["1"]), len(s) - (even["1"] + odd["0"]))))

+import collections + -ans = 0 -for i in range(1, len(s)): -    if s[i - 1] == s[i]: -        ans += 1 -        s[i] = "1" if s[i - 1] == "0" else "0" -print(ans) +even = collections.Counter(s[0::2]) +odd = collections.Counter(s[1::2]) +print((min(len(s) - (even["0"] + odd["1"]), len(s) - (even["1"] + odd["0"]))))