#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int INF = (1 << 30) - 1;
const long long LINF = (1LL << 62) - 1;
const int dx[] = {-1, 0, 1, 0};
const int dy[] = {0, 1, 0, -1};
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < int(n); i++) cin >> a[i];
  vector<pair<ll, ll>> dpm(n + 1), dps(n + 1);
  dpm[0] = {1000, 0};
  dps[0] = {0, 1000};
  for (int i = 1; i <= n; i++) {
    dpm[i] = dpm[i - 1];
    dps[i] = dps[i - 1];
    int stock, money;
    tie(stock, money) = dps[i - 1];
    chmax(dpm[i], {money + stock * a[i - 1], 0});
    tie(money, stock) = dpm[i - 1];
    chmax(dps[i], {stock + money / a[i - 1], money % a[i - 1]});
  }
  cout << dpm[n].first << endl;
  return 0;
}
