#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
constexpr ll LLINF{1001002003004005006};
constexpr int INTINF{1000000000};
template <typename T>
void maxs(T& x, T&& y) {
  x = std::max(x, y);
}
template <typename T>
void maxs(T& x, T& y) {
  x = std::max(x, y);
}
template <typename T>
void mins(T& x, T&& y) {
  x = std::min(x, y);
}
template <typename T>
void mins(T& x, T& y) {
  x = std::min(x, y);
}
using P = std::pair<int, int>;
int main() {
  ios::sync_with_stdio(false);
  std::cin.tie(nullptr);
  int n;
  cin >> n;
  std::vector<int> a(n);
  for (int i = 0; i < (n); ++i) cin >> a[i];
  P stock_now;
  stock_now.first = 1000;
  stock_now.second = 0;
  P money_now;
  money_now.first = 1000;
  money_now.second = 0;
  for (int i = 0; i < (n); ++i) {
    P money_next = money_now;
    if (money_next.first < stock_now.first + stock_now.second * a[i]) {
      money_next.first = stock_now.first + stock_now.second * a[i];
    }
    P stock_next = stock_now;
    if (stock_next.second < money_now.first / a[i]) {
      stock_next.second = money_now.first / a[i];
      stock_next.first = money_now.first % a[i];
    } else if (stock_next.second == money_now.first / a[i]) {
      if (stock_next.first < money_now.first % a[i]) {
        stock_next.first = money_now.first % a[i];
      }
    }
    stock_now = stock_next;
    money_now = money_next;
  }
  std::cout << money_now.first << '\n';
}
