#include <bits/stdc++.h>
using namespace std;
struct fastio {
  fastio() {
    std::ios::sync_with_stdio(false);
    std::cin.tie(nullptr);
  }
} _io;
template <class T, class U>
bool chmax(T &a, const U &b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T, class U>
bool chmin(T &a, const U &b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
int main() {
  int n;
  std::cin >> n;
  vector<int> a(n);
  for (int &e : a) cin >> e;
  a.erase(std::unique(a.begin(), a.end()), a.end());
  n = a.size();
  int l = 0, r = n - 1;
  for (l = 0; l + 1 < n; l++) {
    if (a[l] < a[l + 1]) break;
  }
  for (r = n - 1; r > 0; r--) {
    if (a[r - 1] < a[r]) break;
  }
  int kabu = 0, ans = 1000;
  auto buy = [&](int i) {
    int buff = ans / a[i];
    kabu += buff;
    ans -= (buff * a[i]);
  };
  auto sell = [&](int i) {
    ans += a[i] * kabu;
    kabu = 0;
  };
  for (int i = l; i <= r; i++) {
    if (i == r or (a[i - 1] < a[i] and a[i] > a[i + 1])) {
      sell(i);
    } else if (i == l or (a[i - 1] > a[i] and a[i] < a[i + 1])) {
      buy(i);
    }
  }
  std::cout << ans << '\n';
  return 0;
}
