s = eval(input())

t = []

ans = 0

for i in range(len(s)):

    t += [s[i]]

    if t[-2:] == ["0", "1"] or t[-2:] == ["1", "0"]:

        t.pop()

        t.pop()

        ans += 2



print(ans)

from collections import Counter as C

a=C(eval(input()))

print((min(a["0"],a["1"])*2))
s = eval(input())
t = []
ans = 0
for i in range(len(s)):
    t += [s[i]]
    if t[-2:] == ["0", "1"] or t[-2:] == ["1", "0"]:
        t.pop()
        t.pop()
        ans += 2
print(ans)

from collections import Counter as C

a = C(eval(input()))
print((min(a["0"], a["1"]) * 2))

-s = eval(input()) -t = [] -ans = 0 -for i in range(len(s)): -    t += [s[i]] -    if t[-2:] == ["0", "1"] or t[-2:] == ["1", "0"]: -        t.pop() -        t.pop() -        ans += 2 -print(ans) +from collections import Counter as C + +a = C(eval(input())) +print((min(a["0"], a["1"]) * 2))