#include <bits/stdc++.h>
using namespace std;
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
int main() {
  int64_t N;
  cin >> N;
  vector<int> vec(N);
  for (int i = 0; i < N; i++) {
    cin >> vec.at(i);
  }
  int max_v = 0;
  int max_i = 0;
  int min_v = INT_MAX;
  int min_i = 0;
  vector<pair<int, int>> uridoki;
  vector<pair<int, int>> kaidoki;
  for (int i = N - 1; i >= 0; i--) {
    int n = vec[i];
    if (n > max_v) {
      max_v = n;
      max_i = i;
    } else if (max_v != 0) {
      uridoki.emplace_back(make_pair(max_i, max_v));
      max_v = 0;
      max_i = 0;
    }
  }
  reverse(uridoki.begin(), uridoki.end());
  for (int i = 0; i < N; i++) {
    int n = vec[i];
    if (n < min_v) {
      min_v = n;
      min_i = i;
    } else if (min_v != 0) {
      kaidoki.emplace_back(make_pair(min_i, min_v));
      min_v = INT_MAX;
      min_i = 0;
    }
  }
  int kaidoki_rem = kaidoki.size();
  int uridoki_rem = uridoki.size();
  int have_money = 1000;
  int have_kabu = 0;
  if (uridoki.size() == 0 || kaidoki.size() == 0) {
    cout << 1000 << endl;
  } else {
    for (int i = 0; i < kaidoki_rem; i++) {
      if (have_money >= kaidoki[i].second) {
        have_kabu = have_money / kaidoki[i].second;
        have_money = have_money % kaidoki[i].second;
        have_money += have_kabu * uridoki[i].second;
        have_kabu = 0;
      };
    }
    cout << have_money << endl;
  }
  return 0;
}
