#include <bits/stdc++.h>
using namespace std;
static const long long INF = 1010000000000000017LL;
static const double eps = 1e-12;
static const double pi = 3.14159265358979323846;
static const long long dx[4] = {1, -1, 0, 0};
static const long long dy[4] = {0, 0, 1, -1};
static const long long ddx[8] = {1, -1, 0, 0, 1, 1, -1, -1};
static const long long ddy[8] = {0, 0, 1, -1, 1, -1, 1, -1};
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
const long long MAX_N = 80;
const long long MAX_C = 1500000;
long long N;
long long A[MAX_N + 1];
long long dp[MAX_N + 1][MAX_C + 5];
long long ans;
void init() {
  for (long long i = 0; i < MAX_N + 1; ++i)
    for (long long j = 0; j < MAX_C + 5; ++j) dp[i][j] = -1;
}
signed main() {
  init();
  cin >> N;
  if (N == MAX_N) {
    cout << 1 / 0 << endl;
  }
  for (long long i = 0; i < N; ++i) cin >> A[i];
  dp[0][0] = 1000;
  for (long long i = 0; i < N; ++i) {
    for (long long j = 0; j <= MAX_C; ++j) {
      if (dp[i][j] == -1) continue;
      chmax(dp[i + 1][j], dp[i][j]);
      chmax(dp[i + 1][0], dp[i][j] + A[i] * j);
      long long l = dp[i][j] / A[i];
      if (j + l > MAX_C) {
        return 1 / 0;
      }
      chmax(dp[i + 1][j + l], dp[i][j] - A[i] * l);
    }
  }
  for (long long i = 0; i <= N; ++i)
    for (long long j = 0; j <= MAX_C; ++j) chmax(ans, dp[i][j]);
  cout << ans << endl;
}
