#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  std::vector<int> v(n);
  for (int i = 0; i < n; i++) {
    cin >> v.at(i);
  }
  std::vector<int> p(n, 0);
  for (int i = 1; i < n; i++) {
    if (v.at(i) > v.at(i - 1)) {
      p.at(i) = 1;
    }
    if (v.at(i) < v.at(i - 1)) {
      p.at(i) = -1;
    }
  }
  std::vector<int> po(n, 0);
  if (p.at(1) == 1) {
    po.at(0) = -1;
  } else if (p.at(1) == -1) {
    po.at(0) = 1;
  }
  for (int i = 1; i < n - 1; i++) {
    if ((p.at(i) == 1 || p.at(i) == 0) && p.at(i + 1) == -1) {
      po.at(i) = 1;
    } else if ((p.at(i) == -1 || p.at(i) == 0) && p.at(i + 1) == 1) {
      po.at(i) = -1;
    }
  }
  if (p.at(n - 1) == 1) {
    po.at(n - 1) = 1;
  }
  int genkin = 1000;
  int kabu = 0;
  for (int i = 0; i < n; i++) {
    if (po.at(i) == -1) {
      kabu = genkin / v.at(i);
      genkin -= kabu * v.at(i);
    }
    if (po.at(i) == 1 && kabu > 0) {
      genkin += kabu * v.at(i);
      kabu = 0;
    }
  }
  cout << genkin << endl;
}
