#include <bits/stdc++.h>
using namespace std;
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T1, class T2>
ostream& operator<<(ostream& s, pair<T1, T2> P) {
  return s << '<' << P.first << ", " << P.second << '>';
}
template <class T>
ostream& operator<<(ostream& s, vector<T> P) {
  for (long long i = 0; i < P.size(); ++i) {
    if (i > 0) {
      s << " ";
    }
    s << P[i];
  }
  return s;
}
template <class T>
ostream& operator<<(ostream& s, vector<vector<T> > P) {
  for (long long i = 0; i < P.size(); ++i) {
    s << endl << P[i];
  }
  return s << endl;
}
template <class T>
ostream& operator<<(ostream& s, set<T> P) {
  for (__typeof__((P).begin()) it = (P).begin(); it != (P).end(); ++it) {
    s << "<" << *it << "> ";
  }
  return s << endl;
}
template <class T1, class T2>
ostream& operator<<(ostream& s, map<T1, T2> P) {
  for (__typeof__((P).begin()) it = (P).begin(); it != (P).end(); ++it) {
    s << "<" << it->first << "->" << it->second << "> ";
  }
  return s << endl;
}
template <class T>
void show(vector<T> v) {
  for (long long i = 0; i < v.size(); i++) {
    cerr << v[i] << " ";
  }
  cerr << "\n";
}
long long dp[100][2010];
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  long long n;
  cin >> n;
  vector<long long> a(n);
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
  }
  vector<long long> b;
  for (long long i = 0; i < n; i++) {
    bool ok = true;
    for (long long j = 0; j < i; j++) {
      if (a[i] == a[j]) {
        ok = false;
      }
    }
    if (ok) b.push_back(a[i]);
  }
  vector<long long> c;
  c.push_back(1e18);
  for (long long i = 0; i < b.size(); i++) {
    c.push_back(b[i]);
  }
  if (b.back() > b[b.size() - 2])
    c.push_back(0);
  else
    c.push_back(1e18);
  if (b.size() == 0) {
    cout << 0 << endl;
    return 0;
  }
  long long pos = 1000;
  long long kab = 0;
  long long ans = 0;
  for (long long i = 1; i < c.size() - 1; i++) {
    if (c[i - 1] < c[i] && c[i] > c[i + 1]) {
      pos += c[i] * kab;
      kab = 0;
    } else if (c[i - 1] > c[i] && c[i] < c[i + 1]) {
      kab += pos / c[i];
      pos %= c[i];
    }
    chmax(ans, pos);
  }
  cout << ans << endl;
  return 0;
}
