s = input()

count = 0

def str_del(str,index):
    str = str[:index]+str[index+1:]
    return str
 
string = s
can_remove = True
while can_remove:
  new_text = ''
  search_count_10 = string.count('10')
  if search_count_10 > 0:
    new_text = string.replace('10', '', search_count_10)
    count += search_count_10 * 2
    string = new_text

  search_count_01 = string.count('01')
  if search_count_01 > 0:
    new_text = string.replace('01', '', search_count_01)
    count += search_count_01 * 2
    string = new_text
  
  if search_count_01 == 0 and search_count_10 == 0:
    can_remove = False

print(count)
