#include <bits/stdc++.h>
using namespace std;
inline int toInt(string s) {
  int v;
  istringstream sin(s);
  sin >> v;
  return v;
}
template <class T>
inline string toString(T x) {
  ostringstream sout;
  sout << x;
  return sout.str();
}
constexpr double EPS = 1e-9;
constexpr double PI = 3.1415926535897932;
constexpr int INF = 2147483647;
constexpr long long LINF = 1LL << 60;
constexpr long long MOD = 1000000007;
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
void Main() {
  long long N;
  cin >> N;
  vector<long long> A(N);
  for (int i = (0); i < (N); ++i) cin >> A[i];
  vector<long long> B;
  if (A[0] < A[1]) B.push_back(A[0]);
  for (int i = (0); i < (N - 2); ++i) {
    if (A[i] <= A[i + 1] && A[i + 1] >= A[i + 2])
      B.push_back(A[i + 1]);
    else if (A[i] >= A[i + 1] && A[i + 1] <= A[i + 2])
      B.push_back(A[i + 1]);
  }
  if (A[N - 2] < A[N - 1]) B.push_back(A[N - 1]);
  bool flag = true;
  long long ans = 1000, n = 0;
  int K = B.size();
  for (int i = (0); i < (K - 1); ++i) {
    if (B[i] == B[i + 1]) continue;
    if (flag) {
      n += ans / B[i];
      ans -= ans / B[i] * B[i];
      flag = false;
    } else {
      ans += n * B[i];
      n = 0;
      flag = true;
    }
  }
  if (n > 0 && !B.empty()) ans += n * B.back();
  cout << ans << "\n";
  return;
}
int main(void) {
  cin.tie(0);
  cout.tie(0);
  ios_base::sync_with_stdio(0);
  cout << fixed << setprecision(15);
  int t = 1;
  for (int _ = (0); _ < (t); ++_) Main();
  return 0;
}
