#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
using vl = vector<ll>;
using vvl = vector<vl>;
void debug_out() { cout << endl; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cout << H << " ";
  debug_out(T...);
}
template <typename T>
std::ostream &operator<<(std::ostream &os, std::vector<T> vec) {
  for (std::size_t i = 0; i < vec.size(); i++)
    os << vec[i] << (i + 1 == vec.size() ? "" : " ");
  return os;
}
inline void IN(void) { return; }
template <typename First, typename... Rest>
void IN(First &first, Rest &...rest) {
  cin >> first;
  IN(rest...);
  return;
}
template <class T>
bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
bool chmin(T &a, const T &b) {
  if (b < a) {
    a = b;
    return 1;
  }
  return 0;
}
const ll INF = 1LL << 60;
const ll mod = 1000000007;
const int dx[8] = {1, 0, -1, 0, 1, 1, -1, -1};
const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = int(0); i < int(n); i++) cin >> a[i];
  priority_queue<int, vector<int>, greater<int>> pq_min;
  priority_queue<int> pq;
  ll money = 1000;
  for (int i = 0; i < n; i++) {
    if (pq.empty()) {
      pq.push(a[i]);
      pq_min.push(a[i]);
      continue;
    }
    int vmin = pq_min.top(), vmax = pq.top();
    if (vmax <= a[i]) {
      money += (a[i] - vmin) * (money / vmin);
      while (!pq.empty()) {
        pq.pop();
        pq_min.pop();
      }
    }
    pq.push(a[i]);
    pq_min.push(a[i]);
  }
  cout << money << endl;
}
