n = gets.to_i
a = gets.split.map(&:to_i)

cash = 1000

chunks = [*a, 0].each_cons(2).chunk { |a, b| a < b }.to_a
chunks.each do |ok, values|
  next unless ok
  
  lowest = values.first.first
  highest = values.last.last
  cash += (cash / lowest) * (highest - lowest)
end

puts cash
