"use strict"
const create = () => {
    const input = require("fs").readFileSync("/dev/stdin", "utf8").trim().split("\n");
    const res = {
        "list": input, "index": 0, "max": input.length,
        "hasNext": function() {return this.index < this.max},
        "next": function() { if (!this.hasNext()) {throw "ArrayIndexOutOfBoundsException";}else{return this.list[this.index++];}}
    };
    return res;
}
const o = create();
const next = () => o.next()
const nextInt = () => parseInt(o.next())
const nextStrArray = () => o.next().split(" ")
const nextIntArray = () => o.next().split(" ").map(el => parseInt(el))
const nextCharArray = () => o.next().split("")
const hasNext = () => o.hasNext()
const myout = (...x) => console.log(...x)
const Main = () => {
    let n = nextInt()
    let a = nextIntArray()
    let m = 1000
    let s = 0
    let last = 0
    for(let i = a.length; i>=1; i--){
        if(a[i] > a[i-1]){
            last = i
            break
        }
    }

    for(let i = 0; i < last; i++){
        // buy
        if(m > a[i] && a[i] < a[i+1]){
            let cnt = Math.floor(m / a[i])
            m -= cnt * a[i]
            s += cnt
        //sell
        } else if (s > 0 && a[i] > a[i+1]){
            m += s * a[i]
            s = 0
        }
    }
    m += s * a[last]
    console.log(m)
}
Main()
