#include <bits/stdc++.h>
using namespace std;
using ld = long double;
using ll = long long;
using dll = deque<ll>;
using pll = pair<ll, ll>;
using qll = queue<ll>;
using usll = unordered_set<ll>;
using umll = unordered_map<ll, ll>;
using sll = stack<int>;
using vll = vector<ll>;
using vvll = vector<vll>;
constexpr ll kMax = 1e12 + 1;
constexpr ll kMod = 1e9 + 7;
constexpr long double kPI = 3.14159265358979323846;
ll gcd(ll a, ll b) {
  if (a < b) {
    return gcd(b, a);
  }
  ll c = a % b;
  while (c != 0) {
    a = b;
    b = c;
    c = a % b;
  }
  return b;
}
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }
void init() {
  cin.tie(nullptr);
  ios_base::sync_with_stdio(false);
  cout << fixed << setprecision(15);
}
int main() {
  init();
  ll N;
  cin >> N;
  vll A(N), diffs(N, 0);
  ll mmm = 0;
  for (ll(i) = (0); (i) < (N); (i)++) {
    cin >> A[i];
    mmm = max(mmm, A[i]);
    if (i > 0) {
      diffs[i] = A[i] - A[i - 1];
    }
  }
  if (mmm == A[0]) {
    cout << 1000 << endl;
    return 0;
  }
  ll stk = 0;
  ll ans = 1000;
  for (ll(i) = (0); (i) < (N - 1); (i)++) {
    if (stk > 0) {
      if (diffs[i] >= 0 && diffs[i + 1] < 0) {
        ans += stk * A[i];
        stk = 0;
      } else {
      }
    } else {
      if (diffs[i] <= 0 && diffs[i + 1] > 0) {
        ll cnt = ans / A[i];
        ans -= cnt * A[i];
        stk = cnt;
      }
    }
  }
  if (stk > 0) {
    ans += stk * A[N - 1];
  }
  cout << ans << endl;
  return 0;
}
