#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < (int)(n); i++) cin >> a[i];
  vector<ll> dp(n + 1);
  dp[0] = 1000;
  for (int k; k <= n; k++) {
    dp[k] = 0;
    for (int i = 0; i < k - 1; i++) {
      int m = 99999;
      for (int j = i + 1; j < k; j++) {
        m = min(m, a[j]);
      }
      dp[k] = max(dp[k], dp[i] / m * a[k] + dp[i] % m);
    }
  }
  ll ans = 0;
  for (int i = 0; i < (int)(n + 1); i++) ans = max(ans, dp[i]);
  cout << ans << endl;
  return 0;
}
