#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 < n; ++i) cin >> a[i];
  vector<int> dp(n, 1000);
  for (int i = 0; i < n; ++i)
    for (int j = 0; j < n; ++j) {
      if (i >= j) continue;
      if (a[i] >= a[j]) continue;
      int v = (dp[i] / a[i]) * a[j] + dp[i] % a[i];
      for (int k = 0; k < n; ++k)
        if (j <= k) dp[k] = max(dp[k], v);
    }
  cout << dp[n - 1] << endl;
}
