s=[int(i) for i in eval(input())]

ans=0

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

	ans+=s[~-i]==s[i]

	s[i]=not s[~-i]

print(ans)

s = list(eval(input()))



p = ["0", "1"]

f = 1

ans = [0, 0]



for i in s:

    if (p[f] != i):

        ans[0] += 1

    else:

        ans[1] += 1

    f ^= 1



print((min(ans)))

s = [int(i) for i in eval(input())]
ans = 0
for i in range(1, len(s)):
    ans += s[~-i] == s[i]
    s[i] = not s[~-i]
print(ans)

s = list(eval(input()))
p = ["0", "1"]
f = 1
ans = [0, 0]
for i in s:
    if p[f] != i:
        ans[0] += 1
    else:
        ans[1] += 1
    f ^= 1
print((min(ans)))

-s = [int(i) for i in eval(input())] -ans = 0 -for i in range(1, len(s)): -    ans += s[~-i] == s[i] -    s[i] = not s[~-i] -print(ans) +s = list(eval(input())) +p = ["0", "1"] +f = 1 +ans = [0, 0] +for i in s: +    if p[f] != i: +        ans[0] += 1 +    else: +        ans[1] += 1 +    f ^= 1 +print((min(ans)))