#include <bits/stdc++.h>
using namespace std;
using ll = long long int;
using P = pair<int, int>;
int main(void) {
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; i++) cin >> a[i];
  int m = 1000;
  int kabu = 0;
  bool ok = false;
  for (int i = 0; i < n - 1; i++)
    if (a[i] > a[i + 1]) ok = true;
  if (!ok) {
    kabu = m / a[0];
    m -= kabu * a[0];
    m += kabu * a[n - 1];
    cout << m << endl;
    return 0;
  }
  ok = false;
  for (int i = 0; i < n - 1; i++)
    if (a[i] < a[i + 1]) ok = true;
  if (!ok) {
    cout << m << endl;
    return 0;
  }
  int current = 0;
  int maxans = 0;
  int maxkabu = 0;
  int maxkabuv = 0;
  for (int i = 0; i < n - 1; i++) {
    current = a[i];
    if (current < a[i + 1]) {
      m += kabu * current;
      kabu = m / current;
      m -= kabu * current;
      m += kabu * a[i + 1];
      kabu = 0;
      maxans = max(max(kabu * a[i + 1] + maxkabuv, maxans), m);
    } else if (current > a[i + 1]) {
      m += kabu * current;
      kabu = m / a[i + 1];
      m -= kabu * a[i + 1];
    }
    if (kabu > maxkabu) {
      maxkabu = kabu;
      maxkabuv = m;
    }
  }
  cout << maxans << endl;
  return 0;
}
