S = input()
n = 0
flg01, flg10 = True, True
while(1):
    if '01' in S:
        count = S.count('01')
        n += 2 * count
        S = S.replace('01', '')
    else:
        flg01 = False

    if '10' in S:
        count = S.count('10')
        n += 2 * count
        S = S.replace('10', '')
    else:
        flg10 = False
    
    if flg01 == False:
        if flg10 == False:
            break

print(n)