n = gets.chomp.to_i
prices = gets.chomp.split(/\s+/).map(&:to_i)

amount = 1000
i = 0
nstock = 0

state = 0
(0..(n-1)).each do |i|
  if i == n-1
    state = 2
    amount += nstock * prices[i]
    nstock = 0
  end
  if state == 0
    if prices[i] < prices[i+1]
      nstock += amount / prices[i]
      amount = amount % prices[i]
      state = 1
    end
  end
  if state == 1
    if prices[i] > prices[i+1]
      amount += nstock * prices[i]
      nstock = 0
      state = 0
    end
  end
end

puts amount