#include <bits/stdc++.h>
using namespace std;
template <typename Mnd>
struct segment_tree {
  int sz;
  vector<Mnd> data;
  function<Mnd(Mnd, Mnd)> f;
  Mnd e;
  segment_tree(int _sz, function<Mnd(Mnd, Mnd)> _f, Mnd _e) : f(_f), e(_e) {
    sz = 1;
    while (sz < _sz) sz <<= 1;
    data.assign(sz * 2, e);
  }
  Mnd& operator[](const int& k) { return data[k + sz]; }
  void build() {
    for (int i = sz - 1; i > 0; i--) data[i] = f(data[2 * i], data[2 * i + 1]);
  }
  void update(int k, Mnd x) {
    data[k += sz] = x;
    while (k >>= 1) data[k] = f(data[2 * k], data[2 * k + 1]);
  }
  Mnd query(int a, int b) const {
    Mnd l = e, r = e;
    for (a += sz, b += sz; a < b; a >>= 1, b >>= 1) {
      if (a & 1) l = f(l, data[a++]);
      if (b & 1) r = f(r, data[--b]);
    }
    return f(l, r);
  }
};
int main() {
  int n;
  cin >> n;
  segment_tree<long long> a(
      n, [](long long a, long long b) { return max(a, b); }, 0);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  a.build();
  bool has_kab = false;
  int kab = 0;
  long long money = 1000;
  for (int i = 0; i < n; i++) {
    if (i + 1 < n && a[i] > a[i + 1]) {
      money += kab * a[i];
      kab = 0;
      continue;
    }
    if (a[i] < a.query(i + 1, n)) {
      int nkab = money / a[i];
      kab += nkab;
      money -= nkab * a[i];
    }
  }
  money += kab * a[n - 1];
  cout << money << endl;
}
