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