#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  vector<int> A(N);
  for (int i = 0; i < N; ++i) {
    cin >> A[i];
  }
  int ini = A[0];
  vector<int> B;
  bool minsearch = true;
  for (int i = 1; i < N; ++i) {
    if (minsearch and A[i] > ini) {
      B.push_back(ini);
      ini = A[i];
      minsearch = false;
    } else if (minsearch == false and A[i] < ini) {
      B.push_back(ini);
      ini = A[i];
      minsearch = true;
    }
  }
  if (minsearch == false and A[N] > A[N - 1]) B.push_back(A[N - 1]);
  if (B.size() == 0) B.push_back(A[N - 1]);
  int all = 1000;
  int num = 0, rest = 0;
  for (int i = 0; i < B.size(); ++i) {
    if (i % 2 == 0) {
      num = all / B[i];
      rest = all % B[i];
    } else {
      all = rest + num * B[i];
    }
  }
  if (B.size() % 2 != 0) {
    all = rest + num * B[B.size() - 1];
  }
  cout << all << endl;
  return 0;
}
