N = gets.to_i
ary = gets.split.map(&:to_i)
buy = Array.new(N, false)
sell = Array.new(N, false)
min_val = ary[0]
max_val = ary[0]
last_sell = 0
1.upto(N-1) do |n|
    if ary[n] > ary[n-1]
        buy[n-1] = true
        sell[n] = true
        last_sell = n
    end
    if ary[n] < ary[n-1]
        sell[n-1] = true
        buy[n] = true
        last_sell = n-1
    end
end
budget = 1000
stock = 0
N.times do |n|
    if buy[n] && budget >= ary[n]
        stock = budget.div(ary[n])
        budget = budget - stock * ary[n]
    end
    if sell[n] && stock > 0
        budget = budget + stock * ary[n]
        stock = 0
    end
    break if n == last_sell
end
puts budget