#include <bits/stdc++.h>
using namespace std;
using Pair = pair<long long, pair<int, int>>;
const long long mod = 1000000007;
const long double pi = acos(-1.0);
const long long INF = 1LL << 61;
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;
}
long long gcd(long long x, long long y) { return y ? gcd(y, x % y) : x; }
long long lcm(long long x, long long y) { return x / gcd(x, y) * y; }
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  vector<int> p(n);
  for (int i = 0; i < (int)(n); i++) {
    cin >> p[i];
  }
  int memo = -1;
  for (int i = n - 1; i > 0; i--) {
    if (p[i] > p[i - 1]) {
      memo = i;
      break;
    }
  }
  if (memo == -1) {
    cout << 1000 << "\n";
    return 0;
  }
  long long mon = 1000;
  long long ka = 0;
  ka = mon / p[0];
  mon -= ka * p[0];
  for (int i = 1; i < (int)(n); i++) {
    if (i == memo) {
      mon += ka * p[i];
      break;
    }
    if (p[i - 1] < p[i] && !(i + 1 < n && p[i] < p[i + 1])) {
      mon += ka * p[i];
      ka = 0;
    }
    if (i < n - 1 && p[i] < p[i + 1]) {
      ka += mon / p[i];
      mon -= (mon / p[i]) * p[i];
    }
  }
  cout << mon << "\n";
}
