s = input()
ans = 0
while True:
    pos_0 = s.find('01')
    pos_1 = s.find('10')
    if pos_0==-1 and pos_1==-1:
        break
    pos = max(pos_0,pos_1)
    s = s[:pos]+s[pos+2:]
    ans+=2
print(ans)
