#include <bits/stdc++.h>
using namespace std;
int main() {
  cout << fixed << setprecision(12);
  vector<long long> a;
  long long n;
  cin >> n;
  a.push_back(0);
  for (long long i = 0; i < n; i++) {
    long long t;
    cin >> t;
    a.push_back(t);
  }
  vector<long long> ret(n + 1, 1000);
  for (long long i = 1; i <= n; i++) {
    for (long long j = i; j <= n; j++) {
      for (long long k = j + 1; k <= n; k++) {
        long long cur = ret[i - 1];
        long long s = cur / a[j];
        long long nnext = s * a[k] + cur % a[j];
        ret[k] = max(ret[k], nnext);
      }
    }
  }
  cout << ret[n] << endl;
  return 0;
}
long long MOD = ((long long)1e9 + 7);
struct mod {
  long long x;
  mod(long long tx = 0) {
    x = tx;
    x %= MOD;
  }
  mod& operator=(const long long& tx) {
    x = tx % MOD;
    return *this;
  }
  mod& operator=(const mod& m2) {
    x = m2.x;
    return *this;
  }
  mod operator+(const mod& m2) const { return mod((x + m2.x) % MOD); }
  mod& operator+=(const mod& m2) {
    x += m2.x;
    x %= MOD;
    return *this;
  }
  mod operator-(const mod& m2) const { return mod((x - m2.x + MOD) % MOD); }
  mod& operator-=(const mod& m2) {
    x -= m2.x;
    x = (x + MOD) % MOD;
    return *this;
  }
  mod operator*(const mod& m2) const { return mod((x * m2.x) % MOD); }
  mod& operator*=(const mod& m2) {
    x *= m2.x;
    x %= MOD;
    return *this;
  }
  mod mypow(long long k) const {
    mod ret = 1;
    mod cur = x;
    while (k) {
      if (k & 1) {
        ret *= cur;
      }
      cur *= cur;
      k >>= 1;
    }
    return ret;
  }
  mod inv() const { return mypow(MOD - 2); }
  mod operator/(const mod& m2) const { return (*this) * m2.inv(); }
  mod& operator/=(const mod& m2) {
    x *= m2.inv().x;
    x %= MOD;
    return *this;
  }
  bool operator<(const mod& m2) const { return x < m2.x; }
};
ostream& operator<<(ostream& os, const mod& m) { return os << m.x; }
