s = input()

count = 0

def str_del(str,index):
    str = str[:index]+str[index+1:]
    return str

def remove_cube(string):
  new_text = string.replace('10', '', 1)
  if new_text == string:
    new_text = string.replace('01', '', 1)
  return new_text

string = s
can_remove = True
while can_remove:
  removed = remove_cube(string)
  if removed != string:
    string = removed
    count += 2
    can_remove = True
  else:
    can_remove = False

print(count)
