from collections import deque
s = list(input())
queue = deque()
res = 0
for c in s:
    queue.append(c)
    if len(queue) >= 2:
        if "0" in list(queue)[-2:] and "1" in list(queue)[-2:]:
             res += 2
             queue.pop()
             queue.pop()
print(res)
