#include <bits/stdc++.h>
using namespace std;
template <class T>
inline istream& operator>>(istream& c, vector<T>& A) {
  for (int i = 0; i < (A.size()); ++i) c >> A[i];
  return c;
}
const long long linf = (1ll << 61);
const int inf = 1001001001;
const int mod = 1000000007;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  vector<long long> a(n);
  cin >> a;
  long long prev = -1;
  long long now_y = 1000, now_c = 0;
  map<long long, long long> mp;
  set<long long> st;
  for (int i = 0; i < (n); ++i) {
    mp[a[i]]++;
    st.insert(a[i]);
  }
  for (int i = 0; i < (n); ++i) {
    mp[a[i]]--;
    if (mp[a[i]] == 0) st.erase(a[i]);
    if (prev == -1) {
      if (st.lower_bound(a[i] + 1) != st.end()) {
        long long tmp = now_y / a[i];
        now_c += tmp;
        now_y %= a[i];
        prev = a[i];
      }
    } else {
      if (a[i] == prev)
        continue;
      else if (a[i] > prev) {
        long long tmp = now_c * a[i];
        now_y += tmp;
        now_c = 0;
        prev = a[i];
      } else {
        if (st.lower_bound(a[i] + 1) != st.end()) {
          int tmp = now_y / a[i];
          now_c += tmp;
          now_y %= a[i];
          prev = a[i];
        }
      }
    }
  }
  cout << now_y << endl;
  return 0;
}
