// https://atcoder.jp/contests/m-solutions2020/tasks/m_solutions2020_d
// TODO: try to AC
// DP使ってやればできそうなんだけど、相変わらず更新のイメージがうまくもてない
// 変数が多すぎて頭がこんがらがってる

fun main() {
    msolutions2020d()
}

fun msolutions2020d() {
    val n = readLine()!!.toInt()
    val kabuka = readLine()!!.split(" ").map { it.toInt() }
    val cash = IntArray(n + 1) { 0 }
    val kabu = IntArray(n + 1) { 0 }
    val total = IntArray(n + 1) { 0 }
    var current = 1000
    for (i in 1 until n) {
        if (kabuka[i] > kabuka[i - 1]) {
            val buy = current / kabuka[i - 1]
            current += (kabuka[i] - kabuka[i - 1]) * buy
        }
    }
    println(current)
}
