import re

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

#def remove(tower, count):
#  target = len(pattern.findall(tower))
#  if target:
#    remove(pattern.sub('', tower), count + target)
#  else:
#    print(pattern.split(tower))
#    print(count * 2)
    
def remove(tower, count):
  m = pattern.split(tower)
  operation = len(m) - 1
  if operation == 0:
    print(m)
    print(count * 2)
  else:
    remove(''.join(m), count + operation)
    
    

count = 0
remove(input(), count)