#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < a.size(); i++) {
    cin >> a[i];
  }
  bool is_rise = false;
  vector<int> wave(0);
  for (int i = 1; i < n; i++) {
    if (!is_rise) {
      if (a[i - 1] < a[i]) {
        wave.push_back(a[i - 1]);
        is_rise = true;
      }
    } else {
      if (a[i - 1] > a[i]) {
        wave.push_back(a[i - 1]);
        is_rise = false;
      }
    }
  }
  if (wave.empty()) {
    cout << 1000;
    return 0;
  }
  if (wave.back() < a[n - 1] || is_rise == true) {
    wave.push_back(a[n - 1]);
  }
  vector<int> dp(wave.size() + 1, 1000);
  for (int i = 0; i <= wave.size() - 2; i++) {
    if (i % 2 == 0) {
      (dp[i + 2] = max((dp[i + 2]), ((dp[i] % wave[i]) +
                                     ((dp[i] / wave[i]) * wave[i + 1]))));
    }
  }
  cout << dp.back() << endl;
  return 0;
}
