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