#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  vector<long long int> A(N);
  vector<int> B(N);
  for (int i = 0; i < N; i++) {
    cin >> A.at(i);
  }
  for (int i = 0; i < N; i++) {
    if (i == 0) {
      if (A.at(i) < A.at(i + 1)) {
        B.at(i) = -1;
      }
      continue;
    }
    if (i == N - 1) {
      B.at(i) = i;
      continue;
    }
    if (A.at(i - 1) < A.at(i) && A.at(i) >= A.at(i + 1)) {
      B.at(i) = i;
    } else if (A.at(i - 1) > A.at(i) && A.at(i) <= A.at(i + 1)) {
      B.at(i) = -i;
    }
  }
  long long int stock = 0, cash = 1000;
  for (int i = 0; i < N; i++) {
    if (B.at(i) == 0) {
      continue;
    }
    if (B.at(i) < 0) {
      int tmp;
      tmp = cash / A.at(i);
      stock += tmp;
      cash -= tmp * A.at(i);
    }
    if (B.at(i) > 0) {
      cash += stock * A.at(i);
      stock = 0;
    }
  }
  cout << cash << endl;
}
