#include <bits/stdc++.h>
using namespace std;
mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());
const long long maxn = 101;
pair<long long, long long> dp[maxn][2];
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0), cout.tie(0);
  long long n;
  cin >> n;
  vector<long long> a(n + 1);
  for (long long i = 1; i <= n; i++) {
    cin >> a[i];
  }
  dp[0][0] = {1000, 0};
  dp[0][1] = {1000, 0};
  for (long long i = 1; i <= n; i++) {
    for (long long j = 0; j < i; j++) {
      long long val = dp[j][0].first / a[i] + dp[j][0].second;
      if (val > dp[i][1].second ||
          (val == dp[i][1].second && dp[j][0].first % a[i] > dp[j][1].first)) {
        dp[i][1] = {dp[j][0].first % a[i], val};
      }
      val = dp[j][1].second * a[i] + dp[j][1].first;
      if (val > dp[i][0].first) {
        dp[i][0] = {val, 0};
      }
    }
  }
  long long ans = 1000;
  for (long long i = 0; i <= n; i++) {
    ans =
        max(ans, max(dp[i][0].first, dp[i][1].first + a[i] * dp[i][1].second));
  }
  cout << ans << "\n";
  return 0;
}
