s = eval(input())



ans = float('inf')

for init in '01':

    t = 0

    x = init

    for ss in s:

        # print(ss, x)

        if ss != x:

            t += 1

        if x == '0':

            x = '1'

        else:

            x = '0'

    ans = min(ans, t)

print(ans)

s = eval(input())

N = len(s)

t_01 = '01' * (N // 2) + ('0' if N % 2 == 1 else '')

t_10 = '10' * (N // 2) + ('1' if N % 2 == 1 else '')



# print(s)

# print(t_01)

# print(t_10)



s_n = int(s, 2)

t_01_n = int(t_01, 2)

t_10_n = int(t_10, 2)



# print(s_n)

# print(t_01_n)

# print(t_10_n)



ans = N

for x in s_n ^ t_01_n, s_n ^ t_10_n:

    ans = min(ans, bin(x)[2:].count('1'))



print(ans)



s = eval(input())
ans = float("inf")
for init in "01":
    t = 0
    x = init
    for ss in s:
        # print(ss, x)
        if ss != x:
            t += 1
        if x == "0":
            x = "1"
        else:
            x = "0"
    ans = min(ans, t)
print(ans)

s = eval(input())
N = len(s)
t_01 = "01" * (N // 2) + ("0" if N % 2 == 1 else "")
t_10 = "10" * (N // 2) + ("1" if N % 2 == 1 else "")
# print(s)
# print(t_01)
# print(t_10)
s_n = int(s, 2)
t_01_n = int(t_01, 2)
t_10_n = int(t_10, 2)
# print(s_n)
# print(t_01_n)
# print(t_10_n)
ans = N
for x in s_n ^ t_01_n, s_n ^ t_10_n:
    ans = min(ans, bin(x)[2:].count("1"))
print(ans)

-ans = float("inf") -for init in "01": -    t = 0 -    x = init -    for ss in s: -        # print(ss, x) -        if ss != x: -            t += 1 -        if x == "0": -            x = "1" -        else: -            x = "0" -    ans = min(ans, t) +N = len(s) +t_01 = "01" * (N // 2) + ("0" if N % 2 == 1 else "") +t_10 = "10" * (N // 2) + ("1" if N % 2 == 1 else "") +# print(s) +# print(t_01) +# print(t_10) +s_n = int(s, 2) +t_01_n = int(t_01, 2) +t_10_n = int(t_10, 2) +# print(s_n) +# print(t_01_n) +# print(t_10_n) +ans = N +for x in s_n ^ t_01_n, s_n ^ t_10_n: +    ans = min(ans, bin(x)[2:].count("1"))