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

    val d = mutableListOf(0)
    for (i in 0..a.size - 2) {
        d.add(a[i + 1] - a[i])
    }

    var ans = 1000
    var buy = 0
    var min = 0
    for (i in 1 until d.size) {
        if (d[i] > 0) {
            val numBuy = ans / a[buy]
            ans -= a[buy] * numBuy
            ans += a[i] * numBuy
            buy = i + 1
            min = 0
            continue
        }

        if (min > d[i]) {
            buy = i
            min = d[i]
        }
    }
    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)