#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using vl = vector<ll>;
using vvl = vector<vector<ll>>;
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
signed main() {
  int n;
  cin >> n;
  vl a(n);
  for (int i = 0; i < (long long)(n); i++) cin >> a[i];
  int memo = 0;
  int now = 1000;
  int kabu = 0;
  vector<bool> p(n);
  for (int i = n - 1; i >= 1; --i) {
    if (a[i - 1] < a[i]) p[i - 1] = true;
  }
  for (int i = n - 1; i >= 1; --i) {
    if (a[i - 1] < a[i]) break;
    p[i] = false;
  }
  for (int i = 0; i < (long long)(n); i++) {
    if (p[i]) {
      int j = now / a[i];
      kabu += j;
      now -= j * a[i];
    } else {
      now += kabu * a[i];
      kabu = 0;
    }
  }
  cout << now << endl;
  return 0;
}
