#include <bits/stdc++.h>
using namespace std;
template <class T>
inline bool chmax(T &a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
bool chmin(T &a, const T &b) {
  if (b < a) {
    a = b;
    return 1;
  }
  return 0;
}
const int INF = 1000000000;
int main() {
  int N;
  cin >> N;
  vector<int> A(N);
  for (int i = 0; i < N; i++) cin >> A[i];
  vector<int> prices;
  prices.push_back(A[0]);
  for (int i = 1; i < N - 1; i++) {
    if ((A[i] > A[i - 1]) != (A[i + 1] > A[i])) prices.push_back(A[i]);
  }
  prices.push_back(A[N - 1]);
  int M = prices.size();
  int money, stocks;
  stocks = 0;
  money = 1000;
  string last = "Sell";
  int ans = 1000;
  bool bd = false;
  for (int i = 0; i < M; i++) {
    bd = false;
    if (i < M - 1 and prices[i + 1] > prices[i]) {
      stocks += money / prices[i];
      money -= stocks * prices[i];
      last = "Buy";
      bd = true;
    }
    if (!bd) {
      money += prices[i] * stocks;
      stocks = 0;
      last = "Sell";
    }
    chmax(ans, money);
  }
  money += stocks * prices[M - 1];
  chmax(ans, money);
  cout << ans << endl;
}
