#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000000 + 7;
const string abc = "abacaba";
void solve() {
  int n;
  cin >> n;
  vector<long long> a(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  vector<pair<long long, long long>> dp1(n + 1, {0, 0});
  vector<long long> dp2(n + 1, 0);
  dp1[0] = make_pair(0, 1000);
  dp2[0] = 1000;
  for (int i = 1; i <= n; i++) {
    dp2[i] = max(dp2[i - 1], dp1[i - 1].second + dp1[i - 1].first * a[i - 1]);
    pair<int, int> q = dp1[i - 1],
                   w = {dp2[i - 1] / a[i - 1], dp2[i - 1] % a[i - 1]},
                   e = {dp1[i - 1].first + dp1[i - 1].second / a[i - 1],
                        dp1[i - 1].second % a[i - 1]};
    dp1[i] = max(q, max(w, e));
  }
  cout << dp2[n];
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  solve();
  return 0;
}
