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

val br = BufferedReader(InputStreamReader(System.`in`))
val out = PrintWriter(System.out)

fun main() {
    br.use { out.use {
        solve()
        out.flush()
    } }
}

fun solve() {
    val n = readInteger()
    val aList = readIntegerList() + 0
    val curve = BooleanArray(n + 1)
    for (i in 1 until aList.size) {
        if (aList[i - 1] == aList[i]) {
            curve[i] = curve[i - 1]
        } else {
            curve[i] = aList[i - 1] < aList[i]
        }
    }

    var m = 1000L
    var stock = 0L
    var ansm = m
    for (i in 0 until (n - 1)) {
        if (curve[i]) {
            if (curve[i + 1] == false) {
                m += aList[i] * stock
                stock = 0
            }
        } else {
            if (curve[i + 1] == true) {
                val tmp = m / aList[i]
                stock += tmp
                m -= tmp * aList[i]
            }
        }

        ansm = max(ansm, m)
    }

    m += stock * aList[n - 1]
    ansm = max(ansm, m)
    out.println(ansm)
}

fun readInteger() = Integer.parseInt(br.readLine())
fun readLong() = java.lang.Long.parseLong(br.readLine())
fun readStringList() = br.readLine()!!.split(' ')
fun readIntegerList() = readStringList().map(Integer::parseInt)
fun readLongList() = readStringList().map(java.lang.Long::parseLong)
fun readDoubleList() = readStringList().map(java.lang.Double::parseDouble)


