#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
using LP = pair<ll, ll>;
using ILP = pair<ll, ll>;
using LIP = pair<ll, ll>;
using DP = pair<double, double>;
constexpr ll MOD = 1000000007;
constexpr ll INF = 1000000000;
constexpr ll LINF = 1000000000000000000;
constexpr ll dx[] = {1, 0, -1, 0};
constexpr ll dy[] = {0, 1, 0, -1};
constexpr ll ddx[] = {1, 1, 0, -1, -1, -1, 0, 1};
constexpr ll ddy[] = {0, 1, 1, 1, 0, -1, -1, -1};
template <typename T>
ostream& operator<<(ostream& os, vector<T>& v) {
  for (ll i = 0; i < (ll)v.size(); i++) {
    if (i) os << ' ';
    os << v.at(i);
  }
  return os;
}
template <typename T>
vector<T>& vecin(vector<T>& v, ll n) {
  for (ll i = 0; i < n; i++) {
    cin >> v.at(i);
  }
  return v;
}
template <typename T>
void ln(T a) {
  cout << a << '\n';
}
void Yes(bool b) { ln(b ? "Yes" : "No"); }
ll extgcd(ll a, ll b, ll& x, ll& y) {
  ll d = a;
  if (b != 0) {
    d = extgcd(b, a % b, y, x);
    y -= (a / b) * x;
  } else {
    x = 1;
    y = 0;
  }
  return d;
}
ll inv(ll a, ll mod) {
  ll x, y;
  extgcd(a, mod, x, y);
  return (x + mod) % mod;
}
template <typename T>
T free_pow(T x, ll n) {
  T res = T(1);
  while (n > 0) {
    if (n & 1) res *= x;
    x *= x;
    n >>= 1;
  }
  return res;
}
template <ll mod>
struct modint {
  ll val;
  modint() { val = 0; }
  modint(ll _val) { val = ((_val % mod) + mod) % mod; }
  bool operator==(const modint& rhs) const { return val == rhs.val; }
  bool operator<(const modint& rhs) const { return val < rhs.val; }
  modint operator+(const modint& rhs) const {
    return modint<mod>(val + rhs.val);
  }
  modint operator-(const modint& rhs) const {
    return modint<mod>(val - rhs.val);
  }
  modint operator*(const modint& rhs) const {
    return modint<mod>((ll)((ll)val * rhs.val % mod));
  }
  modint operator/(const modint& rhs) const {
    return modint<mod>((ll)((ll)val * inv(rhs.val, mod) % mod));
  }
  modint& operator+=(const modint& rhs) {
    val = (val + rhs.val) % mod;
    return *this;
  }
  modint& operator-=(const modint& rhs) {
    val = (val - rhs.val + mod) % mod;
    return *this;
  }
  modint& operator*=(const modint& rhs) {
    val = (ll)(((ll)val * rhs.val) % mod);
    return *this;
  }
  modint& operator/=(const modint& rhs) {
    val = (ll)((ll)val * inv(rhs.val, mod) % mod);
    return *this;
  }
  modint& operator++() {
    val = (val + 1) % mod;
    return *this;
  }
  modint operator++(signed) {
    modint<mod> m = *this;
    val = (val + 1) % mod;
    return m;
  }
  modint& operator--() {
    val = (val + mod - 1) % mod;
    return *this;
  }
  modint operator--(signed) {
    modint<mod> m = *this;
    val = (val + mod - 1) % mod;
    return m;
  }
};
struct UniTree {
  vector<ll> par, rank, sz;
  UniTree(ll n) {
    par.resize(n);
    rank.resize(n, 0);
    sz.resize(n, 1);
    for (ll i = 0; i < n; i++) {
      par.at(i) = i;
    }
  }
  ll root(ll x) {
    if (par.at(x) == x)
      return x;
    else
      return par.at(x) = root(par.at(x));
  }
  void merge(ll x, ll y) {
    x = root(x);
    y = root(y);
    if (x == y) return;
    if (rank.at(x) < rank.at(y)) {
      par.at(x) = y;
      sz.at(y) += sz.at(x);
    } else {
      par.at(y) = x;
      if (rank.at(x) == rank.at(y)) rank.at(x)++;
      sz.at(x) += sz.at(y);
    }
  }
  bool same(ll x, ll y) { return root(x) == root(y); }
  ll siz(ll x) { return sz.at(root(x)); }
};
template <typename T>
struct Vect {
  T x, y;
  Vect() {
    x = 0;
    y = 0;
  }
  Vect(T x, T y) {
    this->x = x;
    this->y = y;
  }
  ll posi() const {
    if (x == 0 && y == 0) exit(1);
    if (x > 0 && y == 0) return 0;
    if (x > 0 && y > 0) return 1;
    if (x == 0 && y > 0) return 2;
    if (x < 0 && y > 0) return 3;
    if (x < 0 && y == 0) return 4;
    if (x < 0 && y < 0) return 5;
    if (x == 0 && y < 0) return 6;
    if (x > 0 && y < 0) return 7;
    return -1;
  }
  bool operator<(const Vect& rhs) {
    ll p1 = posi();
    ll p2 = rhs.posi();
    if (p1 != p2) return p1 < p2;
    return rhs.x * y < x * rhs.y;
  }
};
template <typename T>
struct SegTree {
  using Func = function<T(T, T)>;
  ll n;
  vector<T> dat;
  Func func;
  T low;
  SegTree(vector<T> a, Func _func, T _low) {
    ll sz = a.size();
    n = 1;
    low = _low;
    func = _func;
    while (n < sz) n *= 2;
    dat.resize(n * 2 - 1, low);
    for (ll i = 0; i < (ll)(sz); i++) {
      dat.at(i + n - 1) = a.at(i);
    }
    for (ll i = n - 2; i >= 0; i--) {
      dat.at(i) = func(dat.at(i * 2 + 1), dat.at(i * 2 + 2));
    }
  }
  void update(ll k, T val) {
    k += n - 1;
    dat.at(k) = val;
    while (k > 0) {
      k = (k - 1) / 2;
      dat.at(k) = func(dat.at(k * 2 + 1), dat.at(k * 2 + 2));
    }
  }
  T _query(ll a, ll b, ll k, ll l, ll r) {
    if (r <= a || b <= l) return low;
    if (a <= l && r <= b) return dat.at(k);
    T vl = _query(a, b, k * 2 + 1, l, (l + r) / 2);
    T vr = _query(a, b, k * 2 + 2, (l + r) / 2, r);
    return func(vl, vr);
  }
  T query(ll a, ll b) { return _query(a, b, 0, 0, n); }
};
signed main() {
  ll n;
  cin >> n;
  vector<ll> a(n);
  for (ll i = 0; i < (ll)(n); i++) {
    cin >> a.at(i);
  }
  vector<vector<ll>> dp(n + 1, vector<ll>(100000, -INF));
  dp.at(0).at(0) = 1000;
  for (ll i = 0; i < (ll)(n); i++) {
    for (ll j = 0; j < (ll)(100000); j++) {
      if (dp.at(i).at(j) < 0) continue;
      dp.at(i + 1).at(j) = max(dp.at(i + 1).at(j), dp.at(i).at(j));
      dp.at(i + 1).at(0) =
          max(dp.at(i + 1).at(0), dp.at(i + 1).at(j) + a.at(i) * j);
      ll next = j + dp.at(i).at(j) / a.at(i);
      ll mon = dp.at(i).at(j) % a.at(i);
      if (next < 100000) {
        dp.at(i + 1).at(next) = max(dp.at(i + 1).at(next), mon);
      }
    }
  }
  ln(dp.at(n).at(0));
}
