#include <bits/stdc++.h>
using namespace std;
template <typename T>
void debug0(const T &value) {
  cerr << value << endl;
}
template <typename T, typename... Args>
void debug0(const T &value, const Args &...args) {
  cerr << value << ' ';
  debug0(args...);
}
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  auto a = vector<int>(n);
  for (auto &x : a) {
    cin >> x;
  }
  bool finding_min = true;
  int min_price = a[0];
  int max_price = -1;
  long long money = 1000;
  for (int i = 1; i < n; i++) {
    if (finding_min) {
      if (i > 0 && a[i] > a[i - 1]) {
        finding_min = false;
        max_price = a[i];
      } else {
        min_price = min(min_price, a[i]);
      }
    } else {
      if (i > 0 && a[i] < a[i - 1]) {
        ;
        int stock = money / min_price;
        money += stock * (max_price - min_price);
        ;
        finding_min = true;
        min_price = a[i];
        max_price = -1;
      } else {
        max_price = max(max_price, a[i]);
      }
    }
  }
  if (max_price > 0) {
    ;
    auto stock = money / min_price;
    money += stock * (max_price - min_price);
    ;
  }
  cout << money << '\n';
}
