#include <bits/stdc++.h>

using namespace std;

using ll = long long;
using P = pair<ll, ll>;
using Graph = vector<vector<ll>>;
#define rep(i, n) for(ll i=0;i<(ll)(n);i++)
#define rep2(i, m, n) for(ll i=m;i<(ll)(n);i++)
#define rrep(i, n, m) for(ll i=n;i>=(ll)(m);i--)
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
const int ddx[8] = {0, 1, 1, 1, 0, -1, -1, -1};
const int ddy[8] = {1, 1, 0, -1, -1, -1, 0, 1};
const ll MOD = 1000000007;
const ll INF = 1000000000000000000L;
#ifdef __DEBUG

/**
 * For DEBUG
 * https://github.com/ta7uw/cpp-pyprint
 */
#include "cpp-pyprint/pyprint.h"

#endif

void solve() {
    ll N;
    cin >> N;
    vector<ll> A(N);
    rep(i, N) cin >> A[i];
    ll last = A[N - 1];
    vector<ll> buy, sell;
    ll b_i = -1;
    rrep(i, N - 2, 0) {
        ll a = A[i];
        if (last > a) {
            last = a;
            b_i = i;
        }
        if ((b_i != -1 && a > A[b_i]) || (b_i != -1 && i == 0)) {
            buy.push_back(b_i);
            b_i = -1;
            last = a;
        }
    }
    set<ll> B = set(buy.begin(), buy.end());
    ll ans = 1000;
    ll c = 0;
    ll b = -1;
    rep(i, N) {
        ll a = A[i];
        if (B.count(i)) {
            b = a;
            c = ans / a;
            ans -= a * c;
        }
        if (a > b) {
            ans += c * a;
            c = 0;
            b = -1;
        }
    }
    cout << ans << '\n';
}

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(15);
    solve();
    return 0;
}
