def c_coloring_colorfully(S):

    s1 = '10' * (len(S) // 2) + ('1' if len(S) % 2 == 1 else '')

    s2 = '01' * (len(S) // 2) + ('0' if len(S) % 2 == 1 else '')

    ans1 = len([1 for k, s in enumerate(S) if s != s1[k]])

    ans2 = len([1 for k, s in enumerate(S) if s != s2[k]])

    return min(ans1, ans2)



S = eval(input())

print((c_coloring_colorfully(S)))
def c_coloring_colorfully(S):

    ans1 = S[::2].count('0') + S[1::2].count('1')  # 1010...と一致しない数字の数

    ans2 = S[::2].count('1') + S[1::2].count('0')  # 0101...と一致しない数字の数

    return min(ans1, ans2)



S = eval(input())

print((c_coloring_colorfully(S)))
def c_coloring_colorfully(S):
    s1 = "10" * (len(S) // 2) + ("1" if len(S) % 2 == 1 else "")
    s2 = "01" * (len(S) // 2) + ("0" if len(S) % 2 == 1 else "")
    ans1 = len([1 for k, s in enumerate(S) if s != s1[k]])
    ans2 = len([1 for k, s in enumerate(S) if s != s2[k]])
    return min(ans1, ans2)


S = eval(input())
print((c_coloring_colorfully(S)))

def c_coloring_colorfully(S):
    ans1 = S[::2].count("0") + S[1::2].count("1")  # 1010...と一致しない数字の数
    ans2 = S[::2].count("1") + S[1::2].count("0")  # 0101...と一致しない数字の数
    return min(ans1, ans2)


S = eval(input())
print((c_coloring_colorfully(S)))

-    s1 = "10" * (len(S) // 2) + ("1" if len(S) % 2 == 1 else "") -    s2 = "01" * (len(S) // 2) + ("0" if len(S) % 2 == 1 else "") -    ans1 = len([1 for k, s in enumerate(S) if s != s1[k]]) -    ans2 = len([1 for k, s in enumerate(S) if s != s2[k]]) +    ans1 = S[::2].count("0") + S[1::2].count("1")  # 1010...と一致しない数字の数 +    ans2 = S[::2].count("1") + S[1::2].count("0")  # 0101...と一致しない数字の数