s = list(eval(input()))

ans = 0



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

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

        s[i] = "1"

        ans += 1

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

        s[i] = "0"

        ans += 1



print(ans)
s = list(eval(input()))

ans = 0



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

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

        s[i] = "1"

        ans += 1

    elif s[i] == s[i-1] == "1":

        s[i] = "0"

        ans += 1



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

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

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