import re

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

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

count = 0
remove(input(), count)