#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
using u8 = uint8_t;
using u16 = uint16_t;
using u32 = uint32_t;
using u64 = uint64_t;
using i8 = int8_t;
using i16 = int16_t;
using i32 = int32_t;
using i64 = int64_t;
constexpr char newl = '\n';
constexpr double eps = 1e-10;
template <typename T1, typename T2>
inline void chmin(T1& a, T2 b) {
  if (a > b) a = b;
}
template <typename T1, typename T2>
inline void chmax(T1& a, T2 b) {
  if (a < b) a = b;
}
template <class T>
void Print(vector<T> v) {
  for (int i = (0); i < (v.size()); i++) {
    cout << v[i] << ' ';
  }
  cout << newl;
}
signed main() {
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  i64 yen = 1000, kabu = 0;
  int N;
  cin >> N;
  vector<int> bs;
  auto kau = [&](int a) {
    i64 n = yen / a;
    yen -= a * n;
    kabu += n;
  };
  auto uru = [&](int a) {
    yen += a * kabu;
    kabu = 0;
  };
  auto pbs = [&]() {
    if (bs.size() & 1) {
      i64 yenR = yen;
      i64 yenMax = 0;
      for (int skip = (0); skip < (bs.size()); skip++) {
        bool mode = true;
        yen = yenR;
        kabu = 0;
        for (int j = (0); j < (bs.size()); j++) {
          if (j == skip) continue;
          if (mode) {
            kau(bs[j]);
          } else {
            uru(bs[j]);
          }
          mode = !mode;
        }
        chmax(yenMax, yen);
      }
      yen = yenMax;
      kabu = 0;
    } else {
      bool mode = true;
      for (int j = (0); j < (bs.size()); j++) {
        if (mode) {
          kau(bs[j]);
        } else {
          uru(bs[j]);
        }
        mode = !mode;
      }
    }
    bs.clear();
  };
  for (int i = (0); i < (N); i++) {
    int a;
    cin >> a;
    if (bs.size() == 0 || a > bs.back()) {
      bs.push_back(a);
    } else {
      pbs();
    }
  }
  pbs();
  cout << yen;
}
