#include <bits/stdc++.h>
#define REP(i, n) for (long long i = 0; (i) < (long long)(n); ++ (i))
#define REP3(i, m, n) for (long long i = (m); (i) < (long long)(n); ++ (i))
#define REP_R(i, n) for (long long i = (long long)(n) - 1; (i) >= 0; -- (i))
#define REP3R(i, m, n) for (long long i = (long long)(n) - 1; (i) >= (long long)(m); -- (i))
#define REPP(i, n) for (long long i = 1; (i) < (long long)(n+1); ++ (i))
#define REPR(i, n) for (long long i = (long long)(n) - 1; (i) >= 0; -- (i))
#define FOR(i, m, n) for(long long i = m; i < n; i++)
#define FORR(i, m, n) for(long long i=(m)-1; i>=(n); i--)
#define ALL(v) v.begin(), v.end()
#define SZ(a) long long((a).size())
#define SORT(c) sort((c).begin(),(c).end())
#define SORTR(c) sort((c).begin(),(c).end(),greater<long long>());
#define BIT(n) (1LL<<(n))
#define PCNT(x) __builtin_popcountll(x)
#define GCD(x,y) __gcd(x,y)
#define LCM(x,y) x/__gcd(x,y)*y
#define PB push_back
#define MP make_pair
#define endl "\n"
#define yes cout << "Yes" << endl
#define no cout << "No" << endl
using namespace std;
using Graph = vector<vector<long long> >;
using WeightedGraph = vector<vector<pair<long long, long long> > >;
typedef long double LD;
typedef vector<long long> VI;
typedef vector<vector<long long> > VVI;
typedef vector<string> VS;
typedef pair<long long, long long> PII;
typedef vector<PII> VPII;
const long long INF = 2000000000;
const long double PI = acosl(-1);
const long long MOD = 1000000007;


signed main() {
    std::ios::sync_with_stdio(false);
    std::cin.tie(nullptr);
    cout << fixed << setprecision(10);
    long long ans = 0;
    
    long long N;
    cin >> N;
    vector<long long> A(N);
    REP (i, N) {
        cin >> A[i];
    }

    vector<long long> dp(N,0);
    dp[0] = 1000;
    FOR(i,1,N){
        dp[i] = dp[i-1];
        REP(j,i) {
            dp[i] = max(dp[i], dp[j]+(A[i]-A[j])*(dp[j]/A[j]));
        }
    }
    cout << dp[N-1] << endl;


    /*

    long long money = 1000;
    long long now = 0;
    REP(i,N-1) {
        while (A[i] >= A[i+1] && i < N-2) {
            i++;
        }
        now = money / A[i];
        money = money % A[i];
        while (A[i] <= A[i+1] && i < N-1) {
            i++;
        }
        money += now * A[i];
        now = 0;
        money = max(1000,money);
    }
    ans = max(1000,money);
    cout << ans << endl;




    
    ans = 1000;
    long long m = INF;
    long long idm = 0;
    REP(i, N) {
        if (m > A[i]) {
            idm = i;
            m = A[i];
        }
    }
    long long M = 0;
    long long idM = 0;
    FOR(i,idm,N) {
        if (M < A[i]) {
            idM = i;
            M = A[i];
        }
    }
    ans = max(ans, 1000/m * M);

    M = 0;
    idM = 0;
    REP(i, N) {
        if (M < A[i]) {
            idM = i;
            M = A[i];
        }
    }
    m = INF;
    idm = 0;
    FOR(i,0,idM) {
        if (m > A[i]) {
            idm = i;
            m = A[i];
        }
    }
    ans = max(ans, 1000/m * M);
    cout << ans << endl;
    */
    
    
    return 0;
}

/*
cd ~/Desktop/Programming/AtCoder/contest/m-solutions2020/m_solutions2020_d && sh shellscripts/test_cpp.sh
cd ~/Desktop/Programming/AtCoder/contest/m-solutions2020/m_solutions2020_d && sh shellscripts/etest_cpp.sh
cd ~/Desktop/Programming/AtCoder/contest/m-solutions2020/m_solutions2020_d && sh shellscripts/submit_cpp.sh
*/


Measured memory_bytes: 3652