local read = setmetatable({}, {__index = function(t, k) local a = {} for i=1,#k do table.insert(a, '*'..string.sub(k, i, i)) end local r = io.read local u = table.unpack or unpack return function() return r(u(a)) end end})
read.N = function(N) local t={} for i=1,N do t[i]=read.n() end return t end
--
local N = read.n()
local A = read.N(N)
A[N+1] = -9999
local m = 1000
local s = 0
local function buy(a)
    s = s + m // a
    m = m % a
end
local function sell(a)
    m = m + s * a
    s = 0
end
for i=1,N do
    if A[i+1] < A[i] then
        sell(A[i])
    elseif A[i+1] > A[i] then
        buy(A[i])
    end
end
print(m)