#include <bits/stdc++.h>
using namespace std;
template <class T>
inline void chmax(T &ans, T t) {
  if (t > ans) ans = t;
}
template <class T>
inline void chmin(T &ans, T t) {
  if (t < ans) ans = t;
}
template <class T>
T inf = numeric_limits<T>::max();
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  long long N;
  cin >> N;
  vector<long long> A(N);
  for (long long i = 0; i < N; i++) {
    cin >> A[i];
  }
  A[N + 1] = -1;
  vector<long long> que;
  long long money = 1000;
  long long kabu = 0;
  que.push_back(A[0]);
  for (int i = 1; i < N + 1; ++i) {
    if (A[i] < A[i - 1]) {
      if (que.size() <= 1) {
        que.clear();
      } else {
        kabu = money / que.front();
        money -= kabu * que.front();
        money += kabu * que.back();
        kabu = 0;
        que.clear();
        que.push_back(A[i]);
      }
    } else {
      que.push_back(A[i]);
    }
  }
  cout << money << endl;
}
