s = list(eval(input()))

ans = 0



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

    if s[i-1] == s[i] and s[i-1] == "0":

        ans += 1

        s[i] = "1"

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

        ans += 1

        s[i] = "0"

print(ans)
#参考 ： AtCoder # 14682107

s = eval(input())

len = len(s)



if len == 1:

    print((0))

    exit()



even = s[::2]

odd = s[1::2]



#偶数番目に0が並ぶと仮定したときの異物の数

# 0101...

odd_zero = odd.count("0")

even_one = even.count("1")





#奇数番目に0が並ぶと仮定したときの異物の数

# 1010...

odd_one = odd.count("1")

even_zero = even.count("0")



print((min(odd_zero + even_one, odd_one + even_zero)))
s = list(eval(input()))
ans = 0
for i in range(1, len(s)):
    if s[i - 1] == s[i] and s[i - 1] == "0":
        ans += 1
        s[i] = "1"
    if s[i - 1] == s[i] and s[i - 1] == "1":
        ans += 1
        s[i] = "0"
print(ans)

# 参考 ： AtCoder # 14682107
s = eval(input())
len = len(s)
if len == 1:
    print((0))
    exit()
even = s[::2]
odd = s[1::2]
# 偶数番目に0が並ぶと仮定したときの異物の数
# 0101...
odd_zero = odd.count("0")
even_one = even.count("1")
# 奇数番目に0が並ぶと仮定したときの異物の数
# 1010...
odd_one = odd.count("1")
even_zero = even.count("0")
print((min(odd_zero + even_one, odd_one + even_zero)))

-s = list(eval(input())) -ans = 0 -for i in range(1, len(s)): -    if s[i - 1] == s[i] and s[i - 1] == "0": -        ans += 1 -        s[i] = "1" -    if s[i - 1] == s[i] and s[i - 1] == "1": -        ans += 1 -        s[i] = "0" -print(ans) +# 参考 ： AtCoder # 14682107 +s = eval(input()) +len = len(s) +if len == 1: +    print((0)) +    exit() +even = s[::2] +odd = s[1::2] +# 偶数番目に0が並ぶと仮定したときの異物の数 +# 0101... +odd_zero = odd.count("0") +even_one = even.count("1") +# 奇数番目に0が並ぶと仮定したときの異物の数 +# 1010... +odd_one = odd.count("1") +even_zero = even.count("0") +print((min(odd_zero + even_one, odd_one + even_zero)))