fun main() = Thread(null, ::msolutions2020d, "(^o^)", 128 * 1024 * 1024).apply { start() }.join()

@OptIn(ExperimentalStdlibApi::class)
fun msolutions2020d() {
    val n = readLine()!!.toInt()
    val aList = readLine()!!.split(" ").map { it.toInt() }

    var answer = 1000

    for (i in 0 until n - 1) {
        if (aList[i] < aList[i + 1]) {
            val buy = answer / aList[i]
            answer += buy * (aList[i + 1] - aList[i])
        }
    }

    println(answer)
}
