function main()
    n = parse(Int, readline())
    a = parse.(Int, split(readline()))

    ans = 1000
    kabu = 0
    bought = false
    for i in 1:n-1
        if bought
            ans += kabu * a[i]
            bought = false
        end
        if a[i] < a[i+1]
            kabu = ans ÷ a[i]
            ans -= kabu * a[i]
            bought = true
        end
    end

    ans += kabu * a[n]

    println(ans)
end

main()  