#include <bits/stdc++.h>
using namespace std;
using ll = long long;
template <typename T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return 0;
}
template <typename T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return 0;
}
const ll INF = 1LL << 50;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int N;
  cin >> N;
  vector<int> A(N);
  for (auto& a : A) {
    cin >> a;
  }
  vector<ll> dp(N + 1, -INF);
  dp[0] = 1000;
  for (int i = (int)1; i < (int)N + 1; ++i) {
    chmax(dp[i], dp[0]);
    for (int j = (int)1; j < (int)i; ++j)
      for (int k = (int)j; k < (int)i; ++k) {
        chmax(dp[i], (dp[j] / A[k - 1]) * A[i - 1] + dp[j] % A[k - 1]);
      }
  }
  cout << dp[N] << endl;
  return 0;
}
