fun main(args: Array<String>) {
    val n = readInt()
    val a = readIntList()

    var ans = 1000
    for (i in 0 until n - 1) {
        if (a[i + 1] - a[i] > 0) {
            var numBuy = 0
            while (ans >= a[i] * numBuy) {
                numBuy++
            }
            numBuy--
            ans += (a[i + 1] - a[i]) * numBuy
        }
    }
    println(ans)
}

// Tools
fun readString() = readLine()!!
fun readInt() = readLine()!!.toInt()
fun readLong() = readLine()!!.toLong()
fun readStringList() = readLine()!!.split(" ")
fun readIntList() = readLine()!!.split(" ").map(String::toInt)