#include <bits/stdc++.h>
using namespace std;
using P = pair<int, int>;
using ll = long long;
const double PI = acos(-1);
const int mod = 1000000007;
class mint {
  long long x;

 public:
  mint(long long x = 0) : x((x % mod + mod) % mod) {}
  mint operator-() const { return mint(-x); }
  mint& operator+=(const mint& a) {
    if ((x += a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator-=(const mint& a) {
    if ((x += mod - a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator*=(const mint& a) {
    (x *= a.x) %= mod;
    return *this;
  }
  mint operator+(const mint& a) const {
    mint res(*this);
    return res += a;
  }
  mint operator-(const mint& a) const {
    mint res(*this);
    return res -= a;
  }
  mint operator*(const mint& a) const {
    mint res(*this);
    return res *= a;
  }
  mint pow(ll t) const {
    if (!t) return 1;
    mint a = pow(t >> 1);
    a *= a;
    return a;
  }
  mint inv() const { return pow(mod - 2); }
  mint& operator/=(const mint& a) { return (*this) *= a.inv(); }
  mint operator/(const mint& a) const {
    mint res(*this);
    return res /= a;
  }
  friend ostream& operator<<(ostream& os, const mint& m) {
    os << m.x;
    return os;
  }
};
int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < (n); i++) cin >> a[i];
  ll ans = 1000;
  for (int i = 0; i < n; i++) {
    int m = i;
    int p = a[i];
    for (int j = i + 1; j < n; j++) {
      if (a[j] <= p) {
        m = j;
        p = a[j];
      } else
        break;
    }
    if (m >= n - 1) break;
    i = m;
    p = a[i];
    int t = m;
    if (ans < a[i]) continue;
    int cnt = ans / a[i];
    ans -= a[i] * cnt;
    for (int j = i + 1; j < n; j++) {
      if (a[j] >= p) {
        t = j;
        p = a[j];
      } else
        break;
    }
    ans += cnt * a[t];
    i = t;
  }
  cout << ans << endl;
  return 0;
}
