#include <bits/stdc++.h>
using namespace std;
template <class S>
S sum(vector<S>& a) {
  return accumulate(a.begin(), a.end(), S());
}
template <class S>
S max(vector<S>& a) {
  return *max_element(a.begin(), a.end());
}
template <class S>
S min(vector<S>& a) {
  return *min_element(a.begin(), a.end());
}
long long max(int a, long long b) { return max((long long)a, b); }
long long max(long long a, int b) { return max(a, (long long)b); }
long long min(int a, long long b) { return min((long long)a, b); }
long long min(long long a, int b) { return min(a, (long long)b); }
template <class S>
void print(vector<S>& v) {
  for (long long i = 0; i < (long long)v.size(); i++) {
    cerr << v[i] << ' ';
  }
  cerr << endl;
}
template <class S>
void print(vector<vector<S>>& v) {
  for (long long i = 0; i < (long long)v.size(); i++) {
    for (long long j = 0; j < (long long)v[i].size(); j++) {
      cerr << v[i][j] << ' ';
    }
    cerr << endl;
  }
}
const int mod = 1000000007;
struct mint {
  long long x;
  mint(long long x = 0) : x((x % mod + mod) % mod) {}
  mint operator-() const { return mint(-x); }
  mint& operator+=(const mint a) {
    if ((x += a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator-=(const mint a) {
    if ((x += mod - a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator*=(const mint a) {
    (x *= a.x) %= mod;
    return *this;
  }
  mint operator+(const mint a) const { return mint(*this) += a; }
  mint operator-(const mint a) const { return mint(*this) -= a; }
  mint operator*(const mint a) const { return mint(*this) *= a; }
  mint pow(long long t) const {
    if (!t) return 1;
    mint a = pow(t >> 1);
    a *= a;
    if (t & 1) a *= *this;
    return a;
  }
  mint inv() const { return pow(mod - 2); }
  mint& operator/=(const mint a) { return *this *= a.inv(); }
  mint operator/(const mint a) const { return mint(*this) /= a; }
};
istream& operator>>(istream& is, const mint& a) { return is >> a.x; }
ostream& operator<<(ostream& os, const mint& a) { return os << a.x; }
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (long long i = 0; i < (long long)(n); i++) cin >> a[i];
  vector<pair<int, int>> m;
  int i = 0;
  while (i < n) {
    int l = 300;
    int h = 0;
    while (i < n) {
      if (a[i] <= l) {
        l = a[i];
        i++;
      } else {
        break;
      }
    }
    while (i < n) {
      if (a[i] >= h) {
        h = a[i];
        i++;
      } else {
        break;
      }
    }
    if (h > l) m.push_back(make_pair(l, h));
  }
  int money = 1000;
  for (auto [l, h] : m) {
    money += (h - l) * (money / l);
  }
  cout << money << endl;
}
