#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
int main() {
  int N;
  cin >> N;
  vector<int> A(N);
  for (int ii = 0; ii < N; ++ii) {
    cin >> A[ii];
  }
  vector<int> t(N);
  t[0] = -1;
  for (int ii = 0; ii < N - 1; ++ii) {
    if (A[ii] == A[ii + 1]) {
      t[ii + 1] = t[ii];
    } else if (A[ii] < A[ii + 1]) {
      t[ii + 1] = 1;
    } else {
      t[ii + 1] = -1;
    }
  }
  t.push_back(-1);
  int m = 1000;
  int s = 0;
  for (int ii = 0; ii < N; ++ii) {
    if (t[ii] < t[ii + 1]) {
      s = m / A[ii];
      m -= s * A[ii];
    } else if (t[ii] > t[ii + 1]) {
      m += s * A[ii];
      s = 0;
    }
  }
  cout << m << "\n";
  return 0;
}
