from collections import deque
import sys
input=sys.stdin.readline
s=input().rstrip()
d=deque([])
for i in range(len(s)):
    d.append(int(s[i]))
d.append(2)
ans=0
while 0 in d and 1 in d:
    if d[0]+d[1]==1:
        d.popleft()
        d.popleft()
        ans+=2
    else:
        d.rotate(-1)
 
print(ans)