#include <bits/stdc++.h>
using namespace std;
inline void print() { cout << endl; }
template <typename First, typename... Rest>
void print(const First &first, const Rest &...rest) {
  cout << first << ' ';
  print(rest...);
}
int N;
vector<int> A;
int ans = 0;
int before_action;
void rec(int n, int money, int stock, int before_action) {
  if (n == N - 1) {
    ans = max(ans, money + A[n] * stock);
    return;
  }
  int money_copy = money;
  int stock_copy = stock;
  rec(n + 1, money, stock, before_action);
  int buy = money / A[n];
  money -= A[n] * buy;
  stock += buy;
  if (A[n - 1] <= A[n] && before_action == 1) {
    rec(n + 1, money, stock, 0);
  }
  money = money_copy;
  stock = stock_copy;
  int sell = stock;
  money += A[n] * stock;
  stock = 0;
  if (A[n + 1] >= A[n] && before_action == 0) {
    rec(n + 1, money, stock, 1);
  }
}
void solve() {
  cin >> N;
  A.resize(N);
  for (int i = 0; i < N; i++) cin >> A[i];
  int money = 1000, stock = 0;
  stock = money / A[0];
  money %= A[0];
  rec(1, money, stock, 0);
  rec(1, 1000, 0, 0);
  rec(1, 1000, 0, 1);
  cout << ans << '\n';
}
int main() {
  cin.tie(nullptr);
  ios_base::sync_with_stdio(false);
  solve();
  return 0;
}
