"use strict";
    
var maxProfit = function(prices) {
    let profit = 0;
    for (let i = 0; i < prices.length - 1; i++) {
        const possibleProfit = prices[i + 1] - prices[i];
        //console.log("possible:" + possibleProfit)
        profit = Math.max(profit + possibleProfit, profit);
    }
    return profit;
};

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;
    
    let answer = 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]);
            // console.log("cnt:" + cnt);
            
            answer += (possibleProfit * cnt);
            money = answer;
            // console.log("answer:" + answer)
        }
    }
    
    console.log(answer);
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));