import re

si = input()

def count_zeroone(s, c):
  if(s.count('01') > 0 or s.count('10') > 0):
    f_l = s.count('01')
    s = re.sub('01','',s)
    f_r = s.count('10')
    s = re.sub('10','',s)
    return count_zeroone(s, (c+f_l+f_r))
  else:
    return (c)
print( (count_zeroone(si, 0) * 2 ) )
