local read = io.read
local floor = math.floor
local N = read("*n")
local A = {}
for i = 1, N do
	A[i] = read("*n")
end

local possession = 1000
local stock = 0

for i = 1, N do
	if A[i - 1] and A[i - 1] < A[i] then
		possession = possession + stock * A[i]
	end
	if A[i + 1] and A[i + 1] > A[i] then
		stock = floor(possession / A[i])
		possession = possession % A[i]
	end
end

print(possession)
