#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n, curr;
  cin >> n;
  vector<int> a(n);
  for (auto i = 0; i < n; ++i) cin >> a[i];
  vector<int> amt(n, 0), stocks(n, 0), extra(n, 0);
  amt[0] = 1000;
  stocks[0] = 1000 / a[0];
  extra[0] = amt[0] - stocks[0] * a[0];
  for (auto i = 0; i < n; ++i) {
    for (auto j = 0; j < i; ++j) {
      amt[i] = max(amt[i], stocks[j] * a[i] + extra[j]);
      curr = amt[j] / a[i];
      if (curr >= stocks[i]) {
        stocks[i] = curr;
        extra[i] = amt[j] - curr * a[i];
      }
    }
  }
  cout << (*max_element(amt.begin(), amt.end())) << endl;
}
int main() {
  int t;
  solve();
  return 0;
}
