#include <bits/stdc++.h>
using namespace std;
int maxProfit(vector<int> &price, int start, int end) {
  if (end <= start) return 0;
  int profit = 0;
  for (int i = start; i < end; i++) {
    for (int j = i + 1; j <= end; j++) {
      if (price[j] > price[i]) {
        int curr_profit = price[j] - price[i] + maxProfit(price, start, i - 1) +
                          maxProfit(price, j + 1, end);
        profit = max(profit, curr_profit);
      }
    }
  }
  return profit;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr), cout.tie(nullptr);
  int n;
  cin >> n;
  vector<int> prices(n);
  for (int i = 0; i < n; i++) cin >> prices[i];
  int i = 0;
  int valley = prices[0];
  int peak = prices[0];
  int maxprofit = 0;
  int cur = 1000;
  while (i < prices.size() - 1) {
    while (i < prices.size() - 1 && prices[i] >= prices[i + 1]) i++;
    valley = 1000 / prices[i];
    cur -= valley * prices[i];
    while (i < prices.size() - 1 && prices[i] <= prices[i + 1]) i++;
    peak = prices[i] * valley;
    cur += peak;
    maxprofit += peak;
  }
  cout << cur;
}
