#include <bits/stdc++.h>
using namespace std;
bool profit(vector<int>::iterator b, vector<int>::iterator e, int value) {
  vector<int>::iterator it;
  for (it = b; it != e && *it >= value; it++)
    ;
  if (it == e) return false;
  int minVal = *it;
  for (it = it + 1; it != e && *it <= minVal; it++)
    ;
  if (it == e) return false;
  return true;
}
bool sell(vector<int>::iterator b, vector<int>::iterator e, int value) {
  if (profit(b, e, value)) {
    return true;
  }
  bool anyLarger = false;
  vector<int>::iterator it;
  for (it = b; it != e; it++) {
    if (*it > value) return false;
  }
  return true;
}
bool buy(vector<int>::iterator b, vector<int>::iterator e, int value) {
  vector<int>::iterator it;
  for (it = b; it != e && *it <= value; it++)
    ;
  if (it == e) return false;
  return true;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  vector<int> v;
  for (int i = 0; i < n; i++) {
    int t;
    cin >> t;
    v.push_back(t);
  }
  int cash = 1000, stock = 0;
  for (int i = 0; i < n; i++) {
    if (stock > 0 && sell(v.begin() + i + 1, v.end(), v[i])) {
      cash += stock * v[i];
      stock = 0;
    } else if (buy(v.begin() + i + 1, v.end(), v[i])) {
      int amount = cash / v[i];
      stock += amount;
      cash -= amount * v[i];
    }
  }
  cout << cash << endl;
  return 0;
}
