a = gets.strip.split("").map(&:to_i)
temp = a
result = 0
while true
  before = false
  i = 0
  skip = true
  temp.each do |b|
    if before != false
      if before != b
        temp.delete_at(i)
        temp.delete_at(i-1)
        skip = false
        result += 2
        break
      end
    else
      before = b
    end
  end
  break if skip
end
puts result