#include <bits/stdc++.h>
using namespace std;
int maxProfit(int price[], int n) {
  int profit = 1000;
  int j = 0, stc = 0;
  for (int i = 1; i < n; i++) {
    if (price[i - 1] > price[i]) {
      j = i;
    }
    if (price[i - 1] <= price[i] && (i + 1 == n || price[i] > price[i + 1])) {
      stc = profit / price[j];
      profit -= stc * price[j];
      profit += stc * price[i];
    }
  }
  return profit;
}
int main() {
  int n;
  cin >> n;
  int price[n];
  for (int i = 0; i < n; ++i) cin >> price[i];
  cout << maxProfit(price, n);
  return 0;
}
