s = gets.chomp

deleted_cube = 0
while !(index1 = s.index("01")).nil? || !(index2 = s.index("10")).nil?
  index = !index1.nil? ? index1 : index2
  s.slice!(index, 2)
  deleted_cube += 2
end
print("#{deleted_cube}\n")