#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
int main(void) {
  int n, mo, k, amari, i;
  mo = 1000;
  cin >> n;
  vector<int> a(n);
  vector<P> dp;
  for (i = 0; i < n; i++) cin >> a[i];
  k = mo / a[0];
  amari = mo % a[0];
  dp.push_back(make_pair(mo, k));
  for (i = 1; i < n; i++) {
    k = max(dp[i - 1].first / a[i], dp[i - 1].second);
    mo = max(dp[i - 1].second * a[i] + amari, dp[i - 1].first);
    if (dp[i - 1].first / a[i] > dp[i - 1].second) {
      amari = dp[i - 1].first % a[i];
    }
    dp.push_back(make_pair(mo, k));
  }
  cout << dp[n - 1].first << endl;
}
