n = gets.to_i
as = gets.split.map &:to_i
money = 1000
stocks = 0
prev = 10000
(0..n-2).each do |i|
  price, forecast = as[i], as[i+1]
  if price < forecast
    x = money / price
    stocks += x
    money -= x * price
  elsif price > forecast
    money += price * stocks
    stocks = 0
  end
end
money += as[-1] * stocks
stocks = 0

p money