N = gets.to_i
ary = gets.split.map(&:to_i)
budget = 1000
stock = 0
(N-1).times do |n|
    budget += stock * ary[n]
    stock = 0
    if ary[n] < ary[n+1]
        stock = budget.div(ary[n])
        budget = budget - stock * ary[n]
    end
end
budget += stock * ary[N-1]
puts budget