#include <bits/stdc++.h>
using namespace std;
const long long INF = 9000000007;
int main() {
  long long N;
  cin >> N;
  vector<long long> A(N + 2);
  A.at(0) = INF;
  for (long long i = 1; i <= N; i++) {
    cin >> A.at(i);
  }
  A.at(N + 1) = A.at(N);
  bool check = false;
  for (long long i = 2; i <= N; i++) {
    if (A.at(1) < A.at(i)) check = true;
  }
  if (!check) {
    cout << 1000 << endl;
    return 0;
  }
  long long kabu = 0, money = 1000;
  for (long long i = 1; i < N; i++) {
    if (A.at(i - 1) > A.at(i)) {
      if (A.at(i) <= A.at(i + 1)) {
        kabu += money / A.at(i);
        money -= A.at(i) * kabu;
      }
    } else if (A.at(i - 1) < A.at(i)) {
      if (A.at(i) >= A.at(i + 1)) {
        money += kabu * A.at(i);
        kabu = 0;
      }
    }
  }
  money += A.at(N) * kabu;
  cout << money << endl;
}
