#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
int main() {
  int n;
  cin >> n;
  vector<int> v(n + 1);
  vector<int> w;
  bool flag = true;
  for (int i = 0; i < (n); ++i) cin >> v[i];
  w.push_back(v[0]);
  if (v[0] > v[1]) flag = false;
  for (int i = 0; i < (n); ++i) {
    if (flag) {
      if (v[i] > v[i + 1]) {
        flag = false;
        w.push_back(v[i]);
      }
    } else {
      if (v[i] < v[i + 1]) {
        flag = true;
        w.push_back(v[i]);
      }
    }
  }
  int peak = w[w.size() - 1];
  for (int i = w.size() - 1; i > 0; i--) {
    if (w[i] < w[i - 1]) peak = w[i - 1];
    if (w[i] > w[i - 1]) break;
  }
  int m = 1000;
  int st = 0;
  for (int i = 0; i < (w.size()); ++i) {
    if (v[i] == peak) {
      m = m + st * w[i];
      st = 0;
      break;
    }
    if (w[i] < w[i + 1]) {
      st = m / w[i];
      m %= w[i];
    } else if (w[i] > w[i + 1]) {
      m = m + st * w[i];
      st = 0;
    }
  }
  cout << m << endl;
}
