//<editor-fold desc="I/O Templates">
private fun readLn() = readLine()!!
private fun readInt() = readLn().toInt()
private fun readLong() = readLn().toLong()
private fun readStrings() = readLn().split(" ")
private fun readInts() = readStrings().map(String::toInt)
private fun readLongs() = readStrings().map(String::toLong)
//</editor-fold>

fun main() {
    val n = readInt()
    val a = readInts()
    var money : Long = 1000
    var stock : Long = 0
    for (i in 0 until n) {
        if (i + 1 < n && a[i] < a[i + 1]) {
            // buy la
            stock += money / a[i]
            money %= a[i]
        } else {
            // sell la
            money += a[i] * stock
            stock = 0
        }
    }
    println(money)
}