#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
constexpr int INF = 1001001001;
constexpr int mod = 1000000007;
template <class T>
inline bool chmax(T& x, T y) {
  if (x < y) {
    x = y;
    return true;
  }
  return false;
}
template <class T>
inline bool chmin(T& x, T y) {
  if (x > y) {
    x = y;
    return true;
  }
  return false;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; ++i) cin >> a[i];
  vector<vector<int>> dp(n + 1, vector<int>(10005, -1));
  dp[0][0] = 1000;
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j <= 10000; ++j) {
      if (dp[i][j] == -1) continue;
      chmax(dp[i + 1][j], dp[i][j]);
      chmax(dp[i + 1][0], dp[i][j] + j * a[i]);
      if (dp[i][j] > 0) {
        int c = dp[i][j] / a[i];
        chmax(dp[i + 1][j + c], dp[i][j] - c * a[i]);
      }
    }
  }
  int ans = 0;
  for (int i = 0; i <= 10000; ++i) chmax(ans, dp[n][i]);
  cout << ans << endl;
}
