#include <bits/stdc++.h>
using namespace std;
int n, m = 1000, s = 0;
void buy(int price) {
  s += m / price;
  m -= price * s;
}
void sell(int price) {
  m += s * price;
  s = 0;
}
int main() {
  cin >> n;
  vector<int> x, p;
  int i = 0, a, b;
  cin >> a;
  x.emplace_back(a);
  while (i < n - 1) {
    cin >> b;
    if (a != b) x.emplace_back(b);
    if (a < b)
      p.emplace_back(1);
    else if (a > b)
      p.emplace_back(-1);
    a = b;
    i++;
  }
  i = 0;
  while (i < x.size() - 1) {
    while (i < x.size() - 1 && p.at(i) == -1) i++;
    if (i != x.size() - 1) buy(x.at(i));
    while (i < x.size() - 1 && p.at(i) == 1) i++;
    sell(x.at(i));
  }
  cout << m;
}
