#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
using Graph = vector<vector<ll>>;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
const int ddx[8] = {0, 1, 1, 1, 0, -1, -1, -1};
const int ddy[8] = {1, 1, 0, -1, -1, -1, 0, 1};
const ll MOD = 1000000007;
const ll INF = 1000000000000000000L;
void solve() {
  ll N;
  cin >> N;
  vector<ll> A(N);
  for (ll i = 0; i < (ll)(N); i++) cin >> A[i];
  ll ans = 1000;
  ll i = 0;
  bool f = true;
  while (i < N) {
    ll a = A[i];
    bool found = false;
    if (f) {
      for (ll j = i + 1; j < (ll)(N); j++) {
        ll b = A[j];
        if (b > a) {
          found = true;
          ll c = ans / a;
          ans -= a * c;
          ans += b * c;
          i = j;
          break;
        }
      }
      if (found) {
        f = false;
      } else {
        cout << 1000 << '\n';
        return;
      }
    } else {
      for (ll j = i + 1; j < (ll)(N); j++) {
        ll b = A[j];
        if (b < a) {
          for (ll k = j + 1; k < (ll)(N); k++) {
            ll c = A[k];
            if (c > b) {
              ll c2 = ans / b;
              ans -= c2 * b;
              ans += c2 * c;
              i = k;
              found = true;
              break;
            }
          }
          if (found) break;
        }
      }
    }
    if (!found) {
      i++;
    }
  }
  cout << ans << '\n';
}
int main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(15);
  solve();
  return 0;
}
