#include <bits/stdc++.h>
using namespace std;
const long long mod1 = 99844353;
const long long mod2 = 1e9 + 7;
void fastio() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
}
long long power(long long x, long long y) {
  long long res = 1;
  while (y > 0) {
    if (y & 1) res *= x;
    y >>= 1;
    x *= x;
  }
  return res;
}
long long power(long long x, long long y, long long mod) {
  long long res = 1;
  x %= mod;
  while (y > 0) {
    if (y & 1) res = (res * x) % mod;
    y >>= 1;
    x = (x * x) % mod;
  }
  return res;
}
struct dsu {
  unordered_map<long long, long long> pr, sz;
  dsu() {
    (this->pr).clear();
    (this->sz).clear();
  }
  void make(long long x) {
    pr[x] = x;
    sz[x] = 1;
  }
  long long getpar(long long x) {
    if (pr[x] == x) return x;
    return pr[x] = getpar(pr[x]);
  }
  void merge(long long x, long long y) {
    x = getpar(x);
    y = getpar(y);
    if (sz[x] < sz[y]) swap(x, y);
    pr[y] = x;
    sz[x] += sz[y];
    sz[y] = 0;
  }
};
class data {
 public:
  long long sum, pref, suff, ans;
  data(long long val) {
    this->sum = val;
    this->pref = this->suff = this->ans = max(0ll, val);
  }
  data() {}
  data combine(data l, data r) {
    data res;
    res.sum = l.sum + r.sum;
    res.pref = max(l.pref, l.sum + r.pref);
    res.suff = max(r.suff, r.sum + l.suff);
    res.ans = max(max(l.ans, r.ans), l.suff + r.pref);
    return res;
  }
};
class Seg_Tree : public data {
 public:
  long long n;
  vector<data> t;
  Seg_Tree(long long cap) {
    this->n = cap;
    (this->t).resize(4 * n);
  }
  void build(vector<long long> &a, long long v, long long tl, long long tr) {
    if (tl == tr) {
      t[v] = data(a[tl]);
    } else {
      long long tm = (tl + tr) / 2;
      build(a, v * 2, tl, tm);
      build(a, v * 2 + 1, tm + 1, tr);
      t[v] = combine(t[v * 2], t[v * 2 + 1]);
    }
  }
  void update(long long v, long long tl, long long tr, long long pos,
              long long new_val) {
    if (tl == tr) {
      t[v] = data(new_val);
    } else {
      long long tm = (tl + tr) / 2;
      if (pos <= tm)
        update(v * 2, tl, tm, pos, new_val);
      else
        update(v * 2 + 1, tm + 1, tr, pos, new_val);
      t[v] = combine(t[v * 2], t[v * 2 + 1]);
    }
  }
  data query(long long v, long long tl, long long tr, long long l,
             long long r) {
    if (l > r) return data(0);
    if (l == tl && r == tr) return t[v];
    long long tm = (tl + tr) / 2;
    return combine(query(v * 2, tl, tm, l, min(r, tm)),
                   query(v * 2 + 1, tm + 1, tr, max(l, tm + 1), r));
  }
};
class LCA {
 public:
  vector<long long> height, euler, first, segtree;
  vector<bool> visited;
  long long n;
  LCA(vector<vector<long long>> &adj, long long root = 0) {
    n = adj.size();
    height.resize(n);
    first.resize(n);
    euler.reserve(n * 2);
    visited.assign(n, false);
    dfs(adj, root);
    long long m = euler.size();
    segtree.resize(m * 4);
    build(1, 0, m - 1);
  }
  void dfs(vector<vector<long long>> &adj, long long node, long long h = 0) {
    visited[node] = true;
    height[node] = h;
    first[node] = euler.size();
    euler.push_back(node);
    for (auto to : adj[node]) {
      if (!visited[to]) {
        dfs(adj, to, h + 1);
        euler.push_back(node);
      }
    }
  }
  void build(long long node, long long b, long long e) {
    if (b == e) {
      segtree[node] = euler[b];
    } else {
      long long mid = (b + e) / 2;
      build(node << 1, b, mid);
      build(node << 1 | 1, mid + 1, e);
      long long l = segtree[node << 1], r = segtree[node << 1 | 1];
      segtree[node] = (height[l] < height[r]) ? l : r;
    }
  }
  long long query(long long node, long long b, long long e, long long L,
                  long long R) {
    if (b > R || e < L) return -1;
    if (b >= L && e <= R) return segtree[node];
    long long mid = (b + e) >> 1;
    long long left = query(node << 1, b, mid, L, R);
    long long right = query(node << 1 | 1, mid + 1, e, L, R);
    if (left == -1) return right;
    if (right == -1) return left;
    return height[left] < height[right] ? left : right;
  }
  long long lca(long long u, long long v) {
    long long left = first[u], right = first[v];
    if (left > right) swap(left, right);
    return query(1, 0, euler.size() - 1, left, right);
  }
};
class Bit_Tree {
 public:
  vector<long long> bit;
  long long n;
  Bit_Tree(long long n) {
    this->n = n + 1;
    bit.assign(n + 1, 0);
  }
  Bit_Tree(vector<long long> a) : Bit_Tree(a.size()) {
    for (size_t i = 0; i < a.size(); i++) add(i, a[i]);
  }
  long long sum(long long idx) {
    long long ret = 0;
    for (++idx; idx > 0; idx -= idx & -idx) ret += bit[idx];
    return ret;
  }
  long long sum(long long l, long long r) { return sum(r) - sum(l - 1); }
  void add(long long idx, long long delta) {
    for (++idx; idx < n; idx += idx & -idx) bit[idx] += delta;
  }
};
class TaskD {
  long long n;
  vector<long long> a;

 public:
  void solveOne(istream &in, ostream &out) {
    in >> n;
    a = vector<long long>(n);
    for (long long i = 0; i < n; i++) in >> a[i];
    long long start = 1000;
    vector<long long> prices;
    long long i = 0;
    while (i < n - 1 && a[i] == a[i + 1]) i++;
    if (a[i] < a[i + 1]) prices.push_back(a[i]);
    long long last = a[i];
    i++;
    while (i < n) {
      if (a[i] < last) {
        long long j = i + 1;
        while (j < n && a[j] < a[j - 1]) j++;
        prices.push_back(a[j - 1]);
        i = j;
        last = a[j - 1];
      } else if (a[i] > last) {
        long long j = i + 1;
        while (j < n && a[j] > a[j - 1]) j++;
        prices.push_back(a[j - 1]);
        i = j;
        last = a[j - 1];
      } else
        i++;
    }
    while (!prices.empty() && ((long long)prices.size()) % 2 == 1)
      prices.pop_back();
    long long fac = 0;
    for (long long i = 0; i < prices.size(); i++) {
      if (i % 2 == 0) {
        fac = start / prices[i];
        start -= fac * prices[i];
      } else {
        start += prices[i] * fac;
      }
    }
    out << max(1000ll, start) << "\n";
  }
  void solve(std::istream &in, std::ostream &out) {
    long long nt = 1;
    for (long long it = 0; it < nt; ++it) {
      solveOne(in, out);
    }
  }
};
signed main() {
  fastio();
  TaskD solver;
  istream &in(cin);
  ostream &out(cout);
  solver.solve(in, out);
  return 0;
}
