#include <bits/stdc++.h>
using namespace std;
template <class T, class U>
void umin(T& x, const U& y) {
  x = min(x, (T)y);
}
template <class T, class U>
void umax(T& x, const U& y) {
  x = max(x, (T)y);
}
template <class T, class U>
void init(vector<T>& v, U x, size_t n) {
  v = vector<T>(n, x);
}
template <class T, class U>
void init(vector<T>& v, U x, size_t n, size_t m...) {
  v = vector<T>(n);
  for (auto& a : v) init(a, x, m);
}
int main(int argc, char** argv) {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cout << setprecision(15);
  if (argc == 2 && atoi(argv[1]) == 123456789)
    freopen("d:\\code\\cpp\\contests\\stdin", "r", stdin);
  int n;
  cin >> n;
  vector<int> a(n);
  for (int(i) = 0; (i) < (n); (i)++) cin >> a[i];
  int sol = 1000;
  const int inf = 1e8;
  const int L = n * 10000;
  vector<vector<int>> dp;
  init(dp, -inf, n + 1, L);
  dp[0][0] = 1000;
  for (int(i) = 1; (i) <= (n); (i)++) {
    for (int(have) = 0; (have) < (L); (have)++) {
      umax(dp[i][have], dp[i - 1][have]);
      if (have && dp[i - 1][have] != -inf) {
        int h = have;
        int m = dp[i - 1][have];
        umax(dp[i][0], m + h * a[i - 1]);
      }
      if (dp[i - 1][have] >= 0) {
        int h = have;
        int m = dp[i - 1][have];
        int q = m / a[i - 1];
        if (q < L) umax(dp[i][q], m - q * a[i - 1]);
      }
    }
  }
  for (int(i) = 0; (i) < (L); (i)++) sol = max(sol, dp[n][i]);
  cout << sol << endl;
  if (argc == 2 && atoi(argv[1]) == 123456789)
    cout << clock() * 1.0 / CLOCKS_PER_SEC << " sec\n";
  return 0;
}
