import java.util.*

fun main(args: Array<String>) {
    val pw = java.io.PrintWriter(System.out)
    Problem.solve(Scanner(System.`in`), pw)
    pw.flush()
}

object Problem {
    fun solve(sc: Scanner, pw: java.io.PrintWriter) {
        var N = sc.next().toInt()
        val A = IntArray(N) { sc.next().toInt() }
        val buy = mutableSetOf(0)
        val sell = mutableSetOf<Int>()
        for (i in 1 until N) {
            if (A[i] - A[i - 1] < 0) buy += i
        }

        var r = N
        for (b in buy.reversed()) {
            if (b < r - 1) {
                sell += r - 1
            } else {
                buy.remove(b)
            }
            r = b
        }
        //dprint(buy)
        //dprint(sell)

        var yen = 1000
        var kabu = 0
        for (i in 0 until N) {
            if (sell.contains(i)) {
                yen += kabu * A[i]
                kabu = 0
            }
            if (buy.contains(i)) {
                kabu += yen / A[i]
                yen -= kabu * A[i]
            }
        }
        pw.println(yen)
    }
}
