#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
constexpr int INF = 1001001001;
constexpr int mod = 1000000007;
template <class T>
inline bool chmax(T& x, T y) {
  if (x < y) {
    x = y;
    return true;
  }
  return false;
}
template <class T>
inline bool chmin(T& x, T y) {
  if (x > y) {
    x = y;
    return true;
  }
  return false;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; ++i) cin >> a[i];
  int cur = a[0];
  int ans = 1000;
  int S = 1000;
  int c = 0;
  bool flag = true;
  for (int i = 1; i < n; ++i) {
    if (flag) {
      if (a[i] <= cur)
        cur = a[i];
      else {
        int buy = S / cur;
        c += buy;
        S -= buy * cur;
        cur = a[i];
        flag = false;
      }
    } else {
      if (a[i] >= cur)
        cur = a[i];
      else {
        S += cur * c;
        cur = a[i];
        c = 0;
        flag = true;
        chmax(ans, S);
      }
    }
  }
  if (c > 0) S += c * a.back();
  chmax(ans, S);
  cout << ans << endl;
}
