s = eval(input())

s = list("".join(s))

ans = 0

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

    if int(s[i-1]) == int(s[i]) == 0:

        s[i] = 1

        ans += 1

    elif int(s[i-1]) == int(s[i]) == 1:

        s[i] = 0

        ans += 1

print(ans)

s = eval(input())

s = list(s)

ans = 0

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

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

        ans += 1

        if s[i] == "0":

            s[i] = "1"

        else:

            s[i] = "0"

print(ans)

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

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

-s = list("".join(s)) +s = list(s) -    if int(s[i - 1]) == int(s[i]) == 0: -        s[i] = 1 +    if s[i] == s[i - 1]: -    elif int(s[i - 1]) == int(s[i]) == 1: -        s[i] = 0 -        ans += 1 +        if s[i] == "0": +            s[i] = "1" +        else: +            s[i] = "0"