#include <bits/stdc++.h>
using namespace std;
using G = vector<vector<int>>;
using M = map<int, int>;
using P = pair<int, int>;
using PQ = priority_queue<int>;
using PQG = priority_queue<int, vector<int>, greater<int>>;
using V = vector<int>;
using ll = long long;
using TU = tuple<int, int, long long int>;
using edge = struct {
  int to;
  int cost;
};
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 int INF = 1e9;
const int MOD = 1e9 + 7;
const ll LINF = 1e18;
int main() {
  int n;
  cin >> n;
  vector<int> a(n + 1);
  for (int i = 0; i < n; i++) cin >> a[i];
  a[n] = INF;
  P p = {0, 1000};
  for (int i = 0; i < n; i++) {
    if (a[i] < a[i + 1]) {
      p.first = p.first + p.second / a[i];
      p.second = p.second - a[i] * (p.second / a[i]);
    } else if (a[i] == a[i + 1]) {
    } else {
      p.second = p.second + p.first * a[i];
      p.first = 0;
    }
  }
  cout << (p.first * a[n - 1] + p.second) << "\n";
  return 0;
}
