#include <bits/stdc++.h>
using namespace std;
vector<long long int> v;
vector<long long int> w, ab, bc;
set<long long int> uo;
map<long long int, long long int> u;
map<long long int, long long int> ww, cc;
vector<pair<long long int, long long int> > uu;
map<long long int, vector<long long int> > uuu;
map<pair<long long int, long long int>, long long int> vo;
map<pair<long long int, long long int>, long long int> vu;
long long int ar[100];
long long int dxx[] = {-1, 0, 1, 0};
long long int dyy[] = {0, 1, 0, -1};
long long int dx[] = {2, 1, -1, -2, -2, -1, 1, 2};
long long int dy[] = {1, 2, 2, 1, -1, -2, -2, -1};
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  char ch;
  string a, b, c;
  double x, y, d, e, f, g, h;
  long long int n, m, i, j, k, p, q, o, l, s, tt = 1, t, z, aa, r = 0;
  while (tt--) {
    v.clear();
    w.clear();
    ww.clear();
    u.clear();
    uu.clear();
    uo.clear();
    vo.clear();
    vu.clear();
    ab.clear();
    bc.clear();
    cc.clear();
    uuu.clear();
    a.clear();
    b.clear();
    c.clear();
    cin >> n;
    for (i = 0; i < n; i++) {
      cin >> o;
      v.push_back(o);
    }
    k = 1000;
    aa = 1000;
    for (i = 0; i < n;) {
      s = 2;
      t = 2;
      j = v[i];
      while (i + 1 < n && v[i] >= v[i + 1]) {
        j = v[i];
        i++;
      }
      if (i + 1 == n) {
        break;
      }
      i++;
      l = v[i];
      while (i + 1 < n && v[i + 1] > v[i]) {
        l = v[i + 1];
        i++;
      }
      i++;
      if (s > 0 && t > 0) {
        z = k / j;
        z *= l;
        z += k % j;
        k = z;
      }
    }
    cout << k << "\n";
  }
  return 0;
}
