N=parse(Int,readline())
A=parse.(Int,split(readline()))
function solve(N,A)
buy=zeros(Int, N)
sell=zeros(Int, N)
buy_flag=false
dA=diff(A)
for i=1:(N-1)
    if dA[i]>0
        if !buy_flag
            buy[i]=1
            buy_flag=true
        end
    elseif dA[i]<0
        if buy_flag
            sell[i]=1
            buy_flag=false
        end
    end
end
if dA[end]>0 & buy_flag
    sell[end]=1
end

money=1000
stock=0
for i=1:N
    if buy[i]==1
        stock=div(money,A[i])
        money=money%A[i]
    end
    if sell[i]==1
        money=money+stock*A[i]
        stock=0
    end
end
print(money)
end
solve(N,A)