local n=io.read("n")
local a={}
for i=1,n do
    a[i]=io.read("n")
end
local motode=1000
for i=1,n-1 do
    if a[i]<a[i+1] then
        local torihiki=motode//a[i]
        motode=motode+(a[i+1]-a[i])*torihiki
    end
end
print(motode)