#include <bits/stdc++.h>
using namespace std;
template <class T>
bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
bool chmin(T &a, const T &b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
int dx[] = {1, 1, 0, -1, -1, -1, 0, 1};
int dy[] = {0, 1, 1, 1, 0, -1, -1, -1};
void f(int i, int j) {}
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < (int)(n); i++) cin >> a[i];
  a.push_back(-1);
  int soko = 0, top = 0, mon = 1000;
  while (true) {
    bool ok = false;
    for (int j = top + 1; j < n; j++) {
      if (a[j - 1] >= a[j] && a[j] < a[j + 1]) {
        soko = j;
      }
      if (a[j - 1] <= a[j] && a[j] > a[j + 1]) {
        top = j;
        ok = true;
        break;
      }
    }
    if (!ok) break;
    int kabu = mon / a[soko];
    mon %= a[soko];
    mon += kabu * a[top];
  }
  cout << mon << endl;
}
