import re

pattern = re.compile(r'01|10')

def remove(tower, count):
  target = len(pattern.findall(tower))
  if target:
    tower = pattern.sub('', tower)
    remove(tower, count + target)
  else:
    print(count * 2)

count = 0
remove(input(), count)