#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e18;
const long long INF = 1e9;
int ci;
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; ++i) cin >> a[i + 1];
  vector<long long> dp(n + 1);
  dp[0] = 1000;
  for (int k = 1; 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);
    }
  }
  long long ans = 0;
  for (int i = 0; i < n + 1; ++i) ans = max(ans, dp[i]);
  cout << ans << "\n";
  return 0;
}
