#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < (n); ++i) {
    cin >> a[i];
  }
  int go;
  for (int i = 0; i < (n); ++i) {
    if (a[n - 2 - i] < a[n - 1 - i]) {
      go = n - 1 - i;
      break;
    }
    if (i == (n - 2)) {
      go = 0;
      break;
    }
  }
  ll m = 1000;
  vector<int> t;
  int s;
  s = a[0];
  int h;
  int ka = 0;
  if (a[0] < a[1]) {
    h = 1;
    ka = 1000 / a[0];
    m -= ka * a[0];
  } else {
    h = -1;
  }
  for (int i = 0; i < (n); ++i) {
    if (i == go) {
      m += ka * a[go];
      break;
    }
    if (h == 1) {
      if (a[i + 1] < a[i]) {
        m += ka * a[i];
        ka = 0;
        h = 0;
      }
    } else {
      if (a[i + 1] > a[i]) {
        ka = m / a[i];
        m -= (m / a[i]) * a[i];
        h = 1;
      }
    }
  }
  cout << m << endl;
  return 0;
}
