#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vll = vector<ll>;
using ii = pair<int, int>;
using vvi = vector<vi>;
using vii = vector<ii>;
using gt = greater<int>;
using minq = priority_queue<int, vector<int>, gt>;
using P = pair<ll, ll>;
const ll LINF = 1e18L + 1;
const int INF = 1e9 + 1;
ll dp[10000][85];
int main() {
  int n;
  cin >> n;
  memset(dp, -1, sizeof(dp));
  vi a(n);
  for (int i = 0; i < (n); ++i) cin >> a[i];
  dp[0][0] = 1000;
  ll maxRest = 1000;
  ll maxStock = 0;
  for (int i = 0; i < (n); ++i) {
    int maxBuy = maxRest / a[i];
    for (int j = 0; j <= maxBuy; j++) {
      for (int s = 0; s < (maxStock + 1); ++s) {
        if (dp[s][i] == -1) break;
        ll ns = s + j;
        dp[ns][i + 1] = max(dp[ns][i + 1], dp[s][i] - j * a[i]);
        maxStock = max(maxStock, ns);
      }
    }
    for (int j = 0; j <= maxStock; j++) {
      if (dp[j][i] == -1) break;
      for (int sell = 0; sell < (j + 1); ++sell) {
        ll nm = dp[j][i] + sell * a[i];
        int nj = j - sell;
        assert(nj >= 0);
        assert(nj < 10000);
        dp[nj][i + 1] = max(dp[nj][i + 1], nm);
        maxRest = max(maxRest, nm);
      }
    }
  }
  printf("%lld\n", maxRest);
  return 0;
}
