fun main() {
    val N = readLine()!!.toInt()
    val A = readLine()!!.split(" ").map { it.toInt() }

    var current = 1000

    for (i in 0 until N - 1) {

        var stock = 0
        if (A[i] < A[i + 1]) {
            stock = current / A[i]
        }
        current += (A[i + 1] - A[i]) * stock
    }
    print(current)
}
