#include <bits/stdc++.h>
using namespace std;
using ll = long long;
constexpr ll MOD = 0x3b9aca07;
constexpr int INF = 0x3f3f3f3f;
constexpr ll INFL = 0x3f3f3f3f3f3f3f3fLL;
ll dp[99][300];
int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(0);
  ll n, k;
  cin >> n;
  vector<ll> a(n);
  for (int i = 0; i < (int)n; ++i) cin >> a[i];
  vector<vector<ll>> dp(99, vector<ll>(600000, -INFL));
  dp[0][0] = 1000;
  for (int i = 0; i < (int)n; ++i) {
    for (int j = 0; j < (int)500000; ++j) {
      if (dp[i][j] == -INFL) continue;
      dp[i + 1][j] = max(dp[i + 1][j], dp[i][j]);
      dp[i + 1][0] = max(dp[i + 1][0], dp[i][j] + a[i] * j);
      ll k = dp[i][j] / a[i];
      dp[i + 1][j + k] = max(dp[i + 1][j + k], dp[i][j] - a[i] * k);
    }
  }
  ll ans = 0;
  for (int i = 0; i < (int)500000; ++i) ans = max(ans, dp[n][i]);
  cout << ans << endl;
  return 0;
}
