import java.io.BufferedReader
import kotlin.math.max

fun main() {
    val br = System.`in`.bufferedReader()
    val n = br.readInt()
    val a = IntArray(n) { br.readInt() }
    var curMoney = 1000
    var curStocks = 0
    var lastPrice = 200
    var boughtPrice = 0

    for (x in 0 until n) {
        val price = a[x]
        if (curStocks == 0) {
            if (price > lastPrice) {
                curStocks = curMoney / lastPrice
                curMoney -= lastPrice * curStocks
                boughtPrice = lastPrice
            }
        } else if (price < lastPrice) {
            curMoney += curStocks * lastPrice
            curStocks = 0
        }
        lastPrice = price

    }
    if (curStocks != 0) {
        curMoney += curStocks * max(boughtPrice, lastPrice)
    }
    print(curMoney)
}


private const val SPACE_INT = ' '.toInt()
private const val ZERO_INT = '0'.toInt()
private const val NL_INT = '\n'.toInt()

private fun BufferedReader.readInt(): Int {
    var ret = read()
    while (ret <= SPACE_INT) {
        ret = read()
    }
    val neg = ret == '-'.toInt()
    if (neg) {
        ret = read()
    }
    ret -= ZERO_INT
    var read = read()
    while (read >= ZERO_INT) {
        ret *= 10
        ret += read - ZERO_INT
        read = read()
    }

    while (read <= SPACE_INT && read != -1 && read != NL_INT) {
        mark(1)
        read = read()
    }
    if (read > SPACE_INT) {
        reset()
    }
    return if (neg) -ret else ret
}