import copy

s = input()
l1 = len(s)

for i in range(n):
    if '01' in s:
        s = s.replace('01', '')
    elif '10' in s:
        s = s.replace('10', '')
    else:
        break
        
print(l1 - len(s))