num = eval(input())

predicted_value = 0

finished = False

i = 1

while i < len(num):

    if num[i] != num[i-1]:

        num = num[:i-1] + num[i+1:]

        predicted_value += 2

        if i > 1:

            i -= 2

        elif i == 1:

            i = 0

    i += 1

print(predicted_value)
Str = eval(input())

minimo = min(Str.count("0"),Str.count("1"))

print((2*minimo))
num = eval(input())
predicted_value = 0
finished = False
i = 1
while i < len(num):
    if num[i] != num[i - 1]:
        num = num[: i - 1] + num[i + 1 :]
        predicted_value += 2
        if i > 1:
            i -= 2
        elif i == 1:
            i = 0
    i += 1
print(predicted_value)

Str = eval(input())
minimo = min(Str.count("0"), Str.count("1"))
print((2 * minimo))

-num = eval(input()) -predicted_value = 0 -finished = False -i = 1 -while i < len(num): -    if num[i] != num[i - 1]: -        num = num[: i - 1] + num[i + 1 :] -        predicted_value += 2 -        if i > 1: -            i -= 2 -        elif i == 1: -            i = 0 -    i += 1 -print(predicted_value) +Str = eval(input()) +minimo = min(Str.count("0"), Str.count("1")) +print((2 * minimo))