#include <bits/stdc++.h>
using namespace std;
int imax = 2147483647;
long long int llimax = 9223372036854775807;
void PV(vector<int> pvv) {
  for (int i = 0; i < (int)(pvv.size()); i++) cout << pvv[i] << " ";
  cout << endl;
}
void PVL(vector<long long int> pvv) {
  for (int i = 0; i < (int)(pvv.size()); i++) cout << pvv[i] << " ";
  cout << endl;
}
int main() {
  int n, mon = 1000, kab = 0, buy = -1, bv, tmp;
  vector<int> v, ko;
  cin >> n;
  v.resize(n + 1);
  ko.resize(n + 1);
  for (int i = 0; i < (int)(n); i++) cin >> v[i];
  v[n] = -1;
  ko[0] = -1;
  for (int i = 1; i <= n; i++) {
    if (v[i - 1] < v[i]) ko[i] = 1;
    if (v[i - 1] > v[i]) ko[i] = -1;
    if (v[i - 1] == v[i]) ko[i] = ko[i - 1];
  }
  for (int i = 1; i <= n; i++) {
    if (ko[i - 1] == -1 && ko[i] == 1) {
      buy = 1;
      bv = v[i - 1];
    }
    if (ko[i - 1] == 1 && ko[i] == -1 && buy == 1) {
      buy = -1;
      tmp = mon / bv;
      mon -= tmp * bv;
      kab += tmp;
      mon += kab * v[i - 1];
      kab = 0;
    }
  }
  cout << mon << endl;
  return 0;
}
