#ifdef _MSC_VER
#include "stdc++.h"
#endif
#ifdef __GNUC__
#include<bits/stdc++.h>
#endif
using namespace std;

using ll = long long;

//vector
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;

//constant
const double EPS = 1e-10;

#define REP(i, n) for (ll i = 0; i < n; i++)
#define FOR(i, s, e) for (ll i = s; i < e; i++)
#define ALL(x) (x).begin(),(x).end()
#define RALL(x) (x).rbegin(), (x).rend()

//debug
#define DUMP(x)  cerr << #x << " = " << (x) << endl;
#define DEBUG(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl;

// vector
//template<typename T> vector<vector<T>> vv(ll H, ll W, T v) { return vector<vector<T>> vec(H, vector<T>(W, v)); }

// view vector
template<typename T> void view(T e) { cout << e << endl; }
template<typename T> void view(const vector<T>& v) { for (const auto& e : v) { cout << e << " "; } cout << endl; }
template<typename T> void view(const vector<vector<T> >& vv) { for (const auto& v : vv) { view(v); } }

// DP
template<class T>bool chmax(T& a, const T& b) { if (a < b) { a = b; return 1; } return 0; }
template<class T>bool chmin(T& a, const T& b) { if (b < a) { a = b; return 1; } return 0; }




// ***************************************


int main(){

    ll N;
    cin >> N;
    vl A(N);
    cin >> A[0];
    ll n = 1;
    REP(i, N - 1){
        ll tmp;
        cin >> tmp;
        if (tmp == A[n - 1]) continue;
        A[n] = tmp;
        n++;
    }


    bool is_inc = (A[0] < A[1]);
    ll money = 1000;
    ll buy;
    ll sell = 0;
    if (is_inc) {buy = A[0];}
    FOR(i, 1, n - 1){
        if (is_inc && (A[i] > A[i + 1])){
            sell = A[i];
            money = money % buy + (money / buy) * sell;
            is_inc = false;
        }
        else if (!is_inc && A[i] < A[i + 1]) {
            buy = A[i];
            is_inc = true;
        }
    }
    
    if (is_inc){
        sell = A[n - 1];
        money = money % buy + (money / buy) * sell;
    }

    cout << money << endl;


    return 0;
}
