s = gets.chomp.split('').map(&:to_i)
i=0
cnt=0
while s.length-1 != i do
  if s[i] != s[i+1]
    s.slice!(i,2)
    i=0
    cnt+=2
  else
    i += 1
  end
  if s.length == (0||1)
    puts cnt
    exit
  end
end
puts cnt