"""
    S：長さNの文字列
    if S[i] = '0':
        color = 'red'
    elif S[i] = '1':
        color = 'blue'
    
    I can remove set of boxes which put together red and blue box.

    output : How many can I remove box?
"""
s = input()
count = 0

while len(s) > 0:
    i = 0

    while i < len(s):
        if i == len(s)-1:
            break
        if (s[i+1] == '0' and s[i+2] =='1') or (s[i+1] == '1' and s[i+2] =='1'):
            s = s[:i+1]+s[i+3:]
            count += 1
            break
        i += 1
    if i == len(s)-1:
            break

print(count*2)