N = gets.to_i
stocks = [300] + gets.split(' ').map(&:to_i)  + [1]
buy_price = stocks[1]
sell_price = stocks[1]
buy_num = 1
sell_num = 1

money = 1000
count = 0



(1..N).each do |i|
  buy_price = stocks[i] if i == 1
  if buy_price < stocks[i]
    buy_price = stocks[buy_num..i].min
    sell_price = stocks[i]
    money += (sell_price - buy_price)*(money/buy_price)
    buy_price = stocks[i]
    buy_num = i
  end
end

puts money
