#include <bits/stdc++.h>
using namespace std;
template <class T>
T input() {
  T t;
  cin >> t;
  return t;
}
void YES(bool flag) { cout << (flag ? "YES" : "NO") << endl; }
void Yes(bool flag) { cout << (flag ? "Yes" : "No") << endl; }
void yes(bool flag) { cout << (flag ? "yes" : "no") << endl; }
const int INF = 1e7;
const long long MOD = 1e9 + 7;
const double pi = 3.141592653589793;
const vector<int> dx = {1, 0, -1, 0};
const vector<int> dy = {0, 1, 0, -1};
vector<long long> dp, a;
long long n;
long long f() {
  vector<map<long long, long long>> q(n + 1);
  q[0][0] = 1000;
  dp[0] = 0;
  for (long long i = 0; i < n; i++) {
    for (auto itr = (q[i]).begin(); itr != (q[i]).end(); itr++) {
      long long tmpm = itr->first * a[i] + itr->second;
      if (dp[i + 1] < tmpm) dp[i + 1] = tmpm;
    }
    for (long long j = 0; j < dp[i + 1] / a[i] + 1; j++) {
      q[i + 1][j] = dp[i + 1] - a[i] * j;
    }
  }
  return q[n][0];
}
void solve() {
  long long ans = 0ll;
  cin >> n;
  a.resize(n);
  dp.resize(n + 1);
  for (long long i = 0; i < n; i++) cin >> a[i];
  cout << f() << endl;
}
int main() {
  cout << fixed << setprecision(20);
  int __t = 1;
  for (long long i = 0; i < __t; i++) {
    solve();
  }
  return 0;
}
