#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> day;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    day.push_back(x);
  }
  int lastday = day.size() - 1;
  while ((lastday > 1) and (day[lastday - 1] > day[lastday])) {
    lastday--;
  }
  int buy = 0;
  int sell = 0;
  int i = buy;
  int m = 1000;
  int stock = 0;
  vector<int> bns;
  while (i < lastday) {
    while (day[i + 1] <= day[i]) {
      i++;
    }
    buy = i;
    if (i >= lastday) {
      cout << m;
      return 0;
    }
    while (day[i + 1] >= day[i]) {
      i++;
    }
    sell = i;
    stock = m / day[buy];
    m = m % day[buy] + (stock * day[sell]);
    i++;
  }
  cout << m;
  return 0;
}
