#include <bits/stdc++.h>
using namespace std;
template <typename T>
ostream &operator<<(ostream &os, vector<T> &v) {
  string sep = " ";
  if (v.size()) os << v[0];
  for (int i = 1; i < v.size(); i++) os << sep << v[i];
  return os;
}
template <typename T>
istream &operator>>(istream &is, vector<T> &v) {
  for (int i = 0; i < v.size(); i++) is >> v[i];
  return is;
}
int main() {
  ios_base::sync_with_stdio(false);
  cout << setprecision(20) << fixed;
  int n;
  cin >> n;
  vector<int> a(n);
  cin >> a;
  vector<pair<long long, long long>> x;
  x.push_back({1000, 0});
  for (int i = 0; i < n; i++) {
    int m = x.size();
    for (int j = 0; j < m; j++) {
      x.push_back({x[j].first + x[j].second * a[i], 0});
      x.push_back({x[j].first % a[i], x[j].second + x[j].first / a[i]});
    }
  }
  long long ans = 0;
  for (int i = 0; i < x.size(); i++) {
    ans = max(ans, x[i].first);
  }
  cout << ans << endl;
  return 0;
}
