#include <bits/stdc++.h>
using namespace std;
const double EPS = 1e-10;
using ll = long long;
using Pi = pair<int, int>;
using Pl = pair<ll, ll>;
ll dp[90][200000];
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = (int)(0); i < (int)(n); i++) cin >> a[i];
  for (int i = (int)(0); i < (int)(90); i++)
    for (int j = (int)(0); j < (int)(200000); j++) dp[i][j] = -1;
  dp[0][0] = 1000;
  for (int i = (int)(0); i < (int)(n); i++)
    for (int j = (int)(0); j < (int)(200000); j++) {
      if (dp[i][j] == -1) continue;
      dp[i + 1][j] = max(dp[i + 1][j], dp[i][j]);
      int k = dp[i][j] / a[i];
      dp[i + 1][j + k] = max(dp[i + 1][j + k], dp[i][j] - a[i] * k);
      dp[i + 1][0] = max(dp[i + 1][0], dp[i][j] + a[i] * j);
    }
  ll ans = 0;
  for (int i = (int)(0); i < (int)(200000); i++) ans = max(ans, dp[n][i]);
  cout << ans << endl;
}
