#include "bits/stdc++.h"
#define pb push_back
#define ss second
#define ff first
#define all(x) x.begin(), x.end()
#define INF 300000000000001
#define ll_max 9000000000000000000
#define PI 3.14159265358979323846L
#define fill(a, n, x) for(int i = 0; i < n; i++) a[i] = x;
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define db(args...) {string _ss = #args; replace(_ss.begin(), _ss.end(), ',' , ' '); stringstream ___s(_ss) ; debug(___s, args);}
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
typedef long long int ll;
typedef long double ld;
typedef vector<pair<ll,ll> > vll;
typedef vector<int> vi;
typedef pair<ll,ll> pll;
ll mod = 1000000007;
const ll N = 300001;
const ll M = log2(N);

struct point
{
    ll x, y;
};

struct node
{
    ll t, p, d, i;
};

void debug(stringstream &s) {}
template <typename T, typename... Args>
void debug(stringstream &s, T a, Args... args)
{
    string word;
    s >> word;
    cerr << word << " = " << a << endl;
    debug(s, args...);
}

ll fast_exp(ll x, ll n)
{
    if(n == 0) return 1;
    if(n & 1) return fast_exp(x, n - 1) * x % mod;
    else
    {
        ll ans = fast_exp(x, n / 2);
        return ans * ans % mod;
    }
}

int main()
{
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    fast;
    int _ = 1;
    //cin >> _;
    int test = 0;
    while(_--)
    {
        test++;
        ll n, m, x = 0, y = 0, k, ans = 1;
        cin >> n;
        ll a[n + 1];
        for(int i = 1; i <= n; i++) {
            cin >> a[i];
        }
        k = 1000;
        ll dp[n + 1] = {};
        dp[0] = k;
        for(int i = 0; i < n; i++)
        {
            for(int j = i + 1; j <= n; j++)
            {
                if(a[i] < a[j])
                    dp[j] = max(dp[j], (dp[i] / a[i]) * a[j] + dp[i] % a[i]);
                else dp[j] = max(dp[j], dp[i]);
            }
        }
        ans = dp[n];
        cout << ans << "\n";
    }
    return 0;
}
