s = input()

length = len(s)
past = ''
cnt=0
while s != past:
    past = s
    s = s.replace('10','',1)
    if past!=s:
        cnt+=2
#    print(past)
    past = s
    s = s.replace('01','',1)
    if past!=s:
        cnt+=2
#    print(past)

print(cnt)