#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
const int INF = 1001001001;
using ll = long long;
using P = pair<int, int>;
template <typename T>
using priority_queue_rev = priority_queue<T, vector<T>, greater<T>>;
int main() {
  int n;
  cin >> n;
  vector<int> a(n), x(n);
  for (int i = (0); i <= ((n)-1); ++i) cin >> a[i];
  int last = 0;
  for (int i = (0); i <= ((n)-1); ++i) {
    if (i == 0) continue;
    if (i == n - 1) continue;
    if (a[i] >= a[i - 1] && a[i] >= a[i + 1]) x[i] = 1;
    if (a[i] <= a[i - 1] && a[i] <= a[i + 1]) x[i] = -1;
    if (a[i] == a[i - 1] && a[i] == a[i + 1]) x[i] = 0;
    last = x[i];
  }
  int m = 1000, s = 0;
  if (a[0] < a[1]) {
    s = m / a[0];
    m %= a[0];
  }
  for (int i = (0); i <= ((n)-1); ++i) {
    if (i == 0) continue;
    if (x[i] == 1) {
      m += a[i] * s;
      s = 0;
    }
    if (x[i] == -1) {
      s += m / a[i];
      m %= a[i];
    }
    if (i == n - 1) {
      m += a[i] * s;
      s = 0;
    }
  }
  cout << m << endl;
  return 0;
}
