import java.util.*

fun main(args: Array<String>) {
    val scan = Scanner(System.`in`)
    var kotlin=scan.nextLine().toInt()
    var arr = scan.nextLine().split(" ").map{ it.trim().toLong() }.toTypedArray()

    var buy : Long= 0
    var money : Long = 1000
    var count : Long = 0
    var remain :Long  = 0
    var xsell: Long = Long.MAX_VALUE
    for(i  in 0..arr.size-2)
    {
        var x = arr[i]
        var y = arr[i+1]

        if(count==0.toLong() && x<xsell && x<y)
        {
            buy = x
            count = (money/x)
            remain = money - (count*x)
            //println("$x buy $money $count $remain")
        }
        if (x>buy && count>0 && x>y)
        {
            money = (count*x) + remain
            count = 0
           // println("$x sell $money $count $remain")
            xsell = x
        }
    }

    if (arr[arr.lastIndex]>buy && count>0)
    {
        money = (count*arr[arr.lastIndex]) + remain
    }

    if(money==(arr[0]*count))
        println("1000")
    else
        println(money)
}
