#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007;
const long long INF = 1000000000000000000;
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;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int N;
  cin >> N;
  vector<long long> A;
  for (int i = 0; i < N; i++) {
    long long a;
    cin >> a;
    if (A.empty() || a != A.back()) A.push_back(a);
  }
  long long money = 1000;
  long long stock = 0;
  long long price = 0;
  set<int> us, ls;
  us.insert(A.size() - 1);
  for (int i = 1; i <= A.size() - 2; i++) {
    if (A[i] > A[i - 1] && A[i] > A[i + 1]) {
      us.insert(i);
    } else if (A[i] < A[i - 1] && A[i] < A[i + 1]) {
      ls.insert(i);
    }
  }
  for (int i = 0; i < A.size(); i++) {
    if (us.count(i) == 1) {
      if (stock == 0) {
        stock += money / A[0];
        money %= A[0];
      }
      money += A[i] * stock;
      stock = 0;
    } else if (ls.count(i) == 1) {
      auto itr = us.upper_bound(i);
      if (itr != us.end()) {
        stock += money / A[i];
        money %= A[i];
      }
    }
  }
  cout << max(money, 1000LL) << endl;
  return 0;
}
