fun main() {
    val n = readInt()
    val a = readInts().map { it.toLong() }
    var prev = 201L
    var index = 0
    var money = 1000L
    var stocks = 0L
    while (index < n) {
        while (index < n && a[index] <= prev) {
            prev = a[index]
            index++
        }
        if (index < n) {
            stocks = money/prev
            money -= stocks * prev
        }
        while (index < n && a[index] >= prev) {
            prev = a[index]
            index++
        }
        if (stocks > 0) {
            money += stocks * prev
            stocks = 0
        }
    }
    println(money)
}

// Input Reader
private fun readLn() = readLine()!!

private fun readStrings() = readLn().trim().split(" ")
private fun readInt() = readLn().toInt()
private fun readInts() = readStrings().map { it.toInt() }
