#include <bits/stdc++.h>
using namespace std;
using Graph = vector<vector<int>>;
using ll = long long;
const ll INF_ll = 1e17;
const int INF = 1e8;
int main() {
  int N;
  cin >> N;
  vector<int> A(N);
  vector<int> up_down(N, 0);
  vector<int> peak_idxs;
  cin >> A[0];
  int prev_up_down = 0;
  for (int i = 1; i < N; i++) {
    cin >> A[i];
    if (A[i - 1] == A[i]) {
      up_down[i] = 0;
      continue;
    }
    if (A[i - 1] < A[i]) {
      up_down[i] = 1;
    } else {
      up_down[i] = -1;
    }
    if (up_down[i] * prev_up_down < 0) {
      peak_idxs.push_back((i - 1) * prev_up_down);
      prev_up_down = up_down[i];
    }
    if (prev_up_down == 0) {
      prev_up_down = up_down[i];
    }
  }
  int a_pre = A[0];
  vector<vector<int>> stock(N, vector<int>(3, 0));
  int buy_times = 0;
  int ans = 1000;
  if (peak_idxs.size() == 0) {
    if (A[0] < A[N - 1]) {
      int stock_num = 1000 / A[0];
      ans = (A[N - 1] - A[0]) * stock_num + 1000;
    }
    cout << ans << endl;
    return 0;
  }
  int buy_v;
  int sell_v;
  if (peak_idxs[0] > 0) {
    buy_v = A[0];
  } else {
    buy_v = A[abs(peak_idxs[0])];
    peak_idxs.erase(peak_idxs.begin());
  }
  if (peak_idxs.size() % 2 == 0) {
    if (A[abs(peak_idxs[peak_idxs.size() - 1])] < A[N - 1]) {
      peak_idxs.push_back(N - 1);
    } else {
      peak_idxs.pop_back();
    }
  }
  int c = 1000;
  int stock_num = c / buy_v;
  c = c - stock_num * buy_v;
  for (int i = 0; i < peak_idxs.size(); i++) {
    if (peak_idxs[i] < 0) {
      buy_v = A[abs(peak_idxs[i])];
      stock_num = c / buy_v;
      c = c - stock_num * buy_v;
      continue;
    }
    c = c + stock_num * A[peak_idxs[i]];
  }
  cout << c << endl;
}
