S = input()
count = 0
prev = -1
while True:
    count += 2*S.count('01')
    S = S.replace('01','')
    count += 2*S.count('10')
    S = S.replace('10','')
    if count == prev:
        break
    else:
        prev = count
print(count)