#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline istream &operator>>(istream &in, vector<T> &v) {
  for (auto &x : v) in >> x;
  return in;
}
template <typename T>
inline ostream &operator<<(ostream &out, const vector<T> &v) {
  for (auto &x : v) cout << x << ' ';
  cout << '\n';
  return out;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  int64_t n;
  cin >> n;
  vector<int64_t> a(n);
  cin >> a;
  vector<pair<int64_t, int64_t> > dp(2);
  dp[0] = {1000, 0};
  int s = 1000 / a[0];
  dp[1] = {1000 - s * a[0], s};
  for (int32_t i = 1; i < n; i++) {
    int first = max(dp[0].first, dp[1].first + dp[1].second * a[i]);
    int second, q;
    if (dp[0].first / a[i] > dp[1].second + dp[1].first / a[i]) {
      second = dp[0].first / a[i];
      q = dp[0].first - a[i] * second;
    } else {
      int u = dp[1].first / a[i];
      second = dp[1].second + u;
      q = dp[1].first - a[i] * u;
    }
    dp[0] = {first, 0};
    dp[1] = {q, second};
  }
  cout << dp[0].first << '\n';
  return 0;
}
