S = str(input())
s = S
res = True
while res == True:
    s = s.replace('01','')
    s = s.replace('10','')
    res0 = s.find('01')
    res1 = s.find('10')
    if res0 == -1 and res1 == -1:
        res = False
print(len(S) - len(s))