#include <bits/stdc++.h>
using namespace std;
using LL = long long;
using ldouble = long double;
using P = pair<int, int>;
using LP = pair<LL, LL>;
static const int INF = INT_MAX;
static const LL LINF = LLONG_MAX;
static const int MIN = INT_MIN;
static const LL LMIN = LLONG_MIN;
static const int MOD = 1e9 + 7;
static const int SIZE = 200005;
const int dx[] = {0, -1, 1, 0};
const int dy[] = {-1, 0, 0, 1};
vector<LL> Div(LL n) {
  vector<LL> ret;
  for (LL i = 1; i * i <= n; ++i) {
    if (n % i == 0) {
      ret.push_back(i);
      if (i * i != n) ret.push_back(n / i);
    }
  }
  sort(ret.begin(), ret.end());
  return ret;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int N;
  cin >> N;
  vector<int> v;
  int t = 0;
  for (int i = 0; i < N; ++i) {
    int a;
    cin >> a;
    if (t != a) {
      v.push_back(a);
    }
    t = v[v.size() - 1];
  }
  vector<int> a;
  a.push_back(v[0]);
  for (int i = 1; i < v.size() - 1; ++i) {
    if (v[i - 1] < v[i] && v[i] > v[i + 1] ||
        v[i - 1] > v[i] && v[i] < v[i + 1]) {
      a.push_back(v[i]);
    }
  }
  a.push_back(v[v.size() - 1]);
  if (a.size() < 1) {
    cout << 1000 << endl;
    return 0;
  }
  int res = 1000;
  int kab = 0;
  for (int i = 0; i < a.size() - 1; ++i) {
    if (a[i] < a[i + 1]) {
      kab += res / a[i];
      res = res % a[i];
    } else {
      res += kab * a[i];
      kab = 0;
    }
  }
  if (v[a.size() - 1] > a[a.size() - 2]) {
    res += kab * a[a.size() - 1];
  }
  cout << res << endl;
  return 0;
}
