#include <bits/stdc++.h>
#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
template <class T>
inline bool setmin(T &a, T b) {
  if (a > b) return a = b, 1;
  return 0;
}
template <class T>
inline bool setmax(T &a, T b) {
  if (a < b) return a = b, 1;
  return 0;
}
template <class T>
inline T fast(T a, T b, T mod) {
  long long res = 1;
  while (b) {
    if (b & 1) res = (res * a) % mod;
    a = (a * a) % mod;
    b >>= 1;
  }
  return res;
}
template <class T>
istream &operator>>(istream &os, vector<T> &container) {
  for (auto &u : container) os >> u;
  return os;
}
template <class T>
ostream &operator<<(ostream &os, const vector<T> &container) {
  for (auto &u : container) os << u << " ";
  return os;
}
template <class T>
inline T gcd(T a, T b) {
  while (b) swap(a %= b, b);
  return abs(a);
}
const long long INF = 1e9 + 7;
const long long mod = 998244353;
const long long BIG_INF = 1e18 + 7;
const long long N = 1e6 + 7;
const long long T = 1 << 20;
const long double inf = 1e18;
long long n, m, q, k, r;
const int MAXI = (200 * 80 + 1000 + 1);
int dp[81][MAXI];
void solve() {
  cin >> n;
  for (int i = 0; i < 81; i++)
    for (int j = 0; j < (MAXI); j++) dp[i][j] = -INF;
  dp[0][0] = 1000;
  for (int i = 1; i <= n; i++) {
    int temp;
    cin >> temp;
    for (int j = 0; j < MAXI; j++) {
      int ile = dp[i - 1][j];
      if (ile >= 0) {
        setmax(dp[i][0], ile + temp * j);
        int kup = ile / temp;
        setmax(dp[i][j + kup], ile - kup * temp);
      }
    }
  }
  cout << dp[n][0] << '\n';
}
signed main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  q = 1;
  for (int i = 1; i <= q; i++) solve();
}
