#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
static const double PI = acos(-1);
static const int INF = 1e9 + 7;
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < (n); ++i) cin >> a[i];
  vector<int> sell;
  vector<int> buy;
  bool hold = false;
  for (int i = 0; i < (n - 1); ++i) {
    if (hold) {
      if (a[i] > a[i + 1]) sell.push_back(a[i]);
      hold = false;
    }
    if (!hold) {
      if (a[i] < a[i + 1]) buy.push_back(a[i]);
      hold = true;
    }
  }
  if (sell.empty() || *sell.rbegin() < a[n - 1]) {
    sell.push_back(a[n - 1]);
  }
  if (buy.empty()) {
    cout << 1000 << endl;
    return 0;
  }
  ll sum = 1000;
  ll nmb = 0;
  for (int i = 0; i < (buy.size()); ++i) {
    nmb = sum / buy[i];
    if (nmb > 0) {
      sum %= buy[i];
    }
    sum += nmb * sell[i];
    nmb = 0;
  }
  cout << sum << endl;
  return 0;
}
