#include <bits/stdc++.h>
using namespace std;
using ll = long long int;
const int inf = 1001001000;
const long long int Inf = 1001001001001001000;
void print(vector<vector<int>> a) {
  for (int i = 0; i < a.size(); i++) {
    for (int j = 0; j < a[i].size(); j++) {
      cout << a[i][j] << " ";
    }
    cout << endl;
  }
}
void print(vector<vector<long long int>> a) {
  for (int i = 0; i < a.size(); i++) {
    for (int j = 0; j < a[i].size(); j++) {
      cout << a[i][j] << " ";
    }
    cout << endl;
  }
}
void print(vector<int> a) {
  int n = a.size();
  for (int j = 0; j < n; j++) {
    if (j != n - 1)
      cout << a[j] << " ";
    else
      cout << a[j] << endl;
  }
}
void print(vector<long long int> a) {
  int n = a.size();
  for (int j = 0; j < n; j++) {
    if (j != n - 1)
      cout << a[j] << " ";
    else
      cout << a[j] << endl;
  }
}
void print(set<int> a) {
  for (auto x : a) cout << x << " ";
  cout << endl;
}
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (int(i) = 0; (i) < (n); (i)++) cin >> a[i];
  a.push_back(0);
  int kane = 1000;
  int kabu = 0;
  vector<int> kyoku(n + 2);
  for (int(i) = 1; (i) < (n + 1); (i)++) {
    if (a[i - 1] < a[i]) {
      kyoku[i] = 1;
    } else if (a[i - 1] > a[i]) {
      kyoku[i] = -1;
    }
  }
  int b = 0;
  int ind = 0;
  vector<pair<int, int>> res;
  for (int(i) = 0; (i) < (n + 1); (i)++) {
    if (b == -1) {
      if (kyoku[i] == 1) {
        res.push_back(pair<int, int>(ind, -1));
      }
    }
    if (b == 1) {
      if (kyoku[i] == -1) {
        res.push_back(pair<int, int>(ind, 1));
      }
    }
    if (kyoku[i] != 0) {
      b = kyoku[i];
      ind = i;
    }
  }
  if (res.size() == 0) {
    cout << 1000 << endl;
    return 0;
  }
  if (res[0].second == 1) {
    kabu = kane / a[0];
    kane = kane % a[0];
  }
  for (int(i) = 0; (i) < (res.size()); (i)++) {
    int f = 0;
    for (int(j) = i + 1; (j) < (res.size()); (j)++) {
      if (res[j].second == 1) f = 1;
    }
    if (res[i].second == 1) {
      kane += kabu * a[res[i].first];
      kabu = 0;
    }
    if (res[i].second == -1 && f == 1) {
      kabu = kane / a[res[i].first];
      kane = kane % a[res[i].first];
    }
  }
  cout << kane << endl;
  return 0;
}
