s = gets.chomp.reverse
c = 0
while s.split('').uniq.length > 1
  a = s.index('01')
  if a 
    c += 2
    s.slice!(a, 2)
  end
  a = s.index('10')
  if a 
    c += 2
    s.slice!(a, 2)
  end
end
puts c