fun main(){
    val n = readLine()!!.split(" ")[0].toInt()
    val a = readLine()!!.split(" ").map { it.toInt() }
    var kabukazu = 0
    var motigane = 1000
    for (i in 0 until n-1){
        motigane += kabukazu * a[i]
        kabukazu = 0
        if (a[i] < a[i + 1]){
            kabukazu += motigane / a[i]
            motigane -= (a[i] * kabukazu)
        }
    }
    motigane += kabukazu * a[n-1]
    println(motigane)
}