"use strict";
    
const main = arg => {
    arg = arg.trim().split("\n");
    const N = parseInt(arg[0].split(" ")[0]);
    const A = arg[1].split(" ").map(n=>parseInt(n));
    
    let profit = 0;
    let money = 1000;
    
    for (let i = 0; i<N; i++) {
        const possibleProfit = A[i + 1] - A[i];
        profit = Math.max(profit + possibleProfit, profit);
        
        // console.log("possibleProfit:" + possibleProfit)
        
        if(possibleProfit > 0) {
            let cnt = Math.floor(money / A[i]);
            money += (possibleProfit * cnt);
        }
    }
    
    console.log(money);
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));