S = eval(input())

ans = 0

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

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

        S = S[:i] + str(1 - int(S[i])) + S[i+1:]

        ans += 1

print(ans)

S = eval(input())

ans = 0

a = S[0]

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

    if S[i] == a:

        ans += 1

    if a == '0':

        a = '1'

    else:

        a = '0'

print(ans)

S = eval(input())
ans = 0
for i in range(1, len(S)):
    if S[i] == S[i - 1]:
        S = S[:i] + str(1 - int(S[i])) + S[i + 1 :]
        ans += 1
print(ans)

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

+a = S[0] -    if S[i] == S[i - 1]: -        S = S[:i] + str(1 - int(S[i])) + S[i + 1 :] +    if S[i] == a: +    if a == "0": +        a = "1" +    else: +        a = "0"