#include <bits/stdc++.h>
using namespace std;
void stockBuySell(vector<int> price, int n) {
  if (n == 1) return;
  int i = 0, cur = 1000;
  while (i < n - 1) {
    while ((i < n - 1) && (price[i + 1] <= price[i])) i++;
    if (i == n - 1) break;
    int buy = i++;
    while ((i < n) && (price[i] >= price[i - 1])) i++;
    int sell = i - 1;
    int bu = cur / price[buy];
    cur = cur - bu * price[buy] + bu * price[sell];
  }
  cout << cur << '\n';
}
int main() {
  int n;
  cin >> n;
  vector<int> price(n);
  for (int i = 0; i < n; ++i) {
    cin >> price[i];
  }
  stockBuySell(price, n);
  return 0;
}
