#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
template <class T>
istream& operator>>(istream& s, vector<T>& v) {
  for (T& x : v) {
    s >> x;
  }
  return s;
}
template <class F, class S>
istream& operator>>(istream& s, pair<F, S>& p) {
  s >> p.first >> p.second;
  return s;
}
int main() {
  int N;
  cin >> N;
  vector<int> A(N);
  cin >> A;
  A.erase(unique(A.begin(), A.end()), A.end());
  N = A.size();
  int prev = 0;
  int cash = 1000;
  int share = 0;
  for (int i = 0; i < (N); i++) {
    if (A[i] > prev) {
      if (i == N - 1 || A[i + 1] < A[i]) {
        cash += share * A[i];
        share = 0;
      } else {
        if (cash > A[i]) {
          int s = cash / A[i];
          share += s;
          cash -= A[i] * s;
        }
      }
    } else if (A[i] < prev) {
      if (i != N - 1 && A[i + 1] > A[i]) {
        if (cash > A[i]) {
          int s = cash / A[i];
          share += s;
          cash -= A[i] * s;
        }
      }
    }
  }
  cout << cash << endl;
}
