#include <bits/stdc++.h>
using ll = long long;
using ull = unsigned long long;
using namespace std;
constexpr int inf = 1 << 30;
constexpr int mo = 1e9 + 7;
constexpr ll infl = 1ll << 60;
int main() {
  cin.tie(nullptr);
  std::ios::sync_with_stdio(false);
  int n;
  cin >> n;
  vector<int> a(n);
  for (auto& b : a) cin >> b;
  vector<ll> dp(n + 1, 1000);
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < i; ++j) dp[i] = max(dp[i], dp[j]);
    for (int j = i + 1; j < n; ++j) {
      int num = dp[i] / a[i];
      dp[j] = max(dp[j], dp[i] + 1ll * num * (a[j] - a[i]));
    }
  }
  ll ans = 0;
  for (int i = 0; i < n; ++i) ans = max(dp[i], ans);
  cout << ans << endl;
  return 0;
}
