#include<bits/stdc++.h>
using namespace std;

int makeMaxProfit(vector<int>& arr, int n, int amt)
{
    long long int currentMoney = amt;
    for(int i=0; i<n-1; ++i)
    {
        if(arr[i] < arr[i+1])
        {
            //Find the number of stocks 
            //that can be purchased.
            long long int numStocks = currentMoney / arr[i];
            //Profit made by that 
            //transaction.
            currentMoney += (arr[i+1] - arr[i]) 
                            * numStocks;
        }
    }
    return currentMoney;
}

int main()
{
    long long int initialAmount = 1000;
    //vector<int> arr = {100 ,130, 130, 130, 115, 115, 150};
//     vector<int> arr = {
// 200, 180, 160, 140, 120, 100};
    long long int n; cin>>n;
    vector<long long int> arr(n); for(auto &it:arr) cin>>it;
    //int n = sizeof(arr) / sizeof(arr[0]);
    cout<<makeMaxProfit(arr, n, initialAmount);
}