s = gets.chomp.split("").map!{|i| i.to_i}
frag = false; int = 0
while frag == false 
  fragi = false
  0.upto(s.length-1) do |i|
	if ( s[i] == 1 and s[i+1] == 0) or (s[i] == 0 and s[i+1] == 1)
      int += 2
      s.slice!(i,2)
      fragi = true
    end
  end
  if fragi == false
    puts int
    frag = true
  end
end