#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.at(i);
  }
  bool b = false;
  for (int i = 1; i < N; i++) {
    if (A.at(i) > A.at(0)) {
      b = true;
      break;
    }
  }
  int index = 0;
  for (int i = 0; i < N - 1; i++) {
    if (A.at(N - i - 1) >= A.at(N - i - 2)) {
      index = N - i - 1;
      break;
    }
  }
  if (b) {
    int money = 1000 - A.at(0) * (1000 / A.at(0));
    int kabu = 1000 / A.at(0);
    if (index == N - 1) {
      for (int i = 0; i < N - 1; i++) {
        if (A.at(i) < A.at(i + 1)) {
          money += kabu * A.at(i + 1);
          kabu = 0;
        } else if (A.at(i) > A.at(i + 1)) {
          kabu += money / A.at(i + 1);
          money -= A.at(i + 1) * (money / A.at(i + 1));
        }
      }
      cout << money + kabu * (A.at(index)) << endl;
    } else {
      for (int i = 0; i <= index; i++) {
        if (A.at(i) < A.at(i + 1)) {
          money += kabu * A.at(i + 1);
          kabu = 0;
        } else if (A.at(i) > A.at(i + 1)) {
          kabu += money / A.at(i + 1);
          money -= A.at(i + 1) * (money / A.at(i + 1));
        }
      }
      cout << money + kabu * (A.at(index)) << endl;
    }
  } else {
    cout << "1000" << endl;
  }
}
