#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];
  }
  vector<int> B;
  B.push_back(A[0]);
  for (int i = 1; i < N; ++i) {
    if (A[i] != A[i - 1]) {
      B.push_back(A[i]);
    }
  }
  vector<int> C;
  if (B[0] < B[1]) C.push_back(B[0]);
  for (int i = 1; i < B.size() - 1; ++i) {
    if (B[i - 1] < B[i] and B[i] > B[i + 1]) C.push_back(B[i]);
    if (B[i - 1] > B[i] and B[i] < B[i + 1]) C.push_back(B[i]);
  }
  if (C.size() % 2 != 0 and B[B.size() - 1] > B[B.size() - 2]) {
    C.push_back(B[B.size() - 1]);
  }
  int all = 1000;
  if (C.size() % 2 == 0) {
    int num = 0, rest = 0;
    for (int i = 0; i < C.size(); ++i) {
      if (i % 2 == 0) {
        num = all / C[i];
        rest = all % C[i];
      } else {
        all = rest + num * C[i];
      }
    }
  } else {
    int num = 0, rest = 0;
    for (int i = 0; i < C.size() - 1; ++i) {
      if (i % 2 == 0) {
        num = all / C[i];
        rest = all % C[i];
      } else {
        all = rest + num * C[i];
      }
    }
  }
  cout << all << endl;
  return 0;
}
