N = gets.to_i
A = gets.split.map &:to_i

m = 1000
stock = 0

(N-1).times do |i|
    if stock > 0 then
        if A[i] > A[i+1] then
            m += stock * A[i]
            stock = 0
        end
    else
        if A[i] < A[i+1] then
            stock = m / A[i]
            m %= A[i]
        end
    end
end

m += stock * A[N-1]
p m