//

fun main() {
    msolutions2020d()
}

fun msolutions2020d() {
    val n = readLine()!!.toInt()
    val a = readLine()!!.split(" ").map { it.toInt() }
    var soko = Int.MAX_VALUE
    var yama = Int.MIN_VALUE
    var current = 1000
    var searchSoko = true
    for (value in a) {
        if (searchSoko) {
            if (soko > value) {
                soko = value
            } else {
                searchSoko = false
                yama = value
            }
        } else {
            if (yama < value) {
                yama = value
            } else {
                searchSoko = true
                if (yama > soko) {
                    val buy = current / soko
                    current += buy * (yama - soko)
                }
                soko = value
                yama = Int.MIN_VALUE
            }
        }
    }
    if (yama > soko) {
        val buy = current / soko
        current += buy * (yama - soko)
    }
    println(current)
}
