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