#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using pli = pair<ll, int>;
using pil = pair<int, ll>;
using uint = unsigned int;
template <typename T>
using Graph = vector<vector<T>>;
const int MOD = 1e9 + 7;
const ld PI = acosl(-1);
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int N;
  cin >> N;
  vector<int> A(N);
  for (int i = 0; i < N; ++i) cin >> A[i];
  vector<ll> dp(N + 1);
  dp[0] = 1000;
  for (int i = 0; i < N; ++i) {
    for (int j = 0; j < i; ++j) {
      int tmp = dp[j] / A[j];
      dp[i + 1] = max(dp[i + 1], dp[j]);
      dp[i + 1] = max(dp[i + 1], dp[j] + (ll)tmp * (A[i] - A[j]));
    }
  }
  cout << dp[N] << endl;
  return 0;
}
