#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  vector<int> A;
  for (int i = 0; i < N; i++) {
    int a;
    cin >> a;
    A.push_back(a);
  }
  bool next_is_cheaper[N + 1];
  next_is_cheaper[N - 1] = true;
  next_is_cheaper[N] = true;
  for (int i = N - 2; i >= 0; i--) {
    if (A[i] > A[i + 1]) {
      next_is_cheaper[i] = true;
    } else if (A[i] < A[i + 1]) {
      next_is_cheaper[i] = false;
    } else {
      next_is_cheaper[i] = next_is_cheaper[i + 1];
    }
  }
  for (int i = 1; i <= N - 2; i++) {
    if (!next_is_cheaper[i - 1] && !next_is_cheaper[i] &&
        !next_is_cheaper[i + 1]) {
      int money = 1000, kabu = 0;
      for (int i = 0; i < N; i++) {
        if (!next_is_cheaper[i]) {
          kabu += money / A[i];
          money = money % A[i];
        } else {
          money += kabu * A[i];
          kabu = 0;
        }
      }
      int now_m = money;
      money = 1000, kabu = 0;
      next_is_cheaper[i] = true;
      for (int i = 0; i < N; i++) {
        if (!next_is_cheaper[i]) {
          kabu += money / A[i];
          money = money % A[i];
        } else {
          money += kabu * A[i];
          kabu = 0;
        }
      }
      if (now_m > money) {
        next_is_cheaper[i] = false;
      }
    }
  }
  int money = 1000, kabu = 0;
  for (int i = 0; i < N; i++) {
    if (!next_is_cheaper[i]) {
      kabu += money / A[i];
      money = money % A[i];
    } else {
      money += kabu * A[i];
      kabu = 0;
    }
  }
  cout << money << endl;
  return 0;
}
