fun main() {
    val n = readInt()
    val a = readInts()
    var prev = 201
    var index = 0
    var money = 1000
    var stocks = 0
    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() }
