#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1);
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
long long lcm(long long a, long long b) { return a / gcd(a, b) * b; }
int main() {
  int n;
  cin >> n;
  vector<int> A(n);
  for (int i = 0; i < n; i++) cin >> A[i];
  int money = 1000;
  int kabu = 0;
  vector<pair<int, int>> pa(0);
  int cnt = 0;
  bool flg1 = false, flg2 = false;
  pair<int, int> p;
  int num = 0;
  while (cnt < n) {
    if (!flg1) {
      p.first = A[cnt];
      p.second = 0;
      flg1 = true;
      num = p.first;
    } else {
      if (!flg2) {
        if (A[cnt] > num) num = A[cnt];
        if (A[cnt] < p.first) {
          p.first = A[cnt];
        } else if (A[cnt] > p.first) {
          p.second = A[cnt];
          pa.push_back(p);
          flg1 = false;
        }
      }
    }
    ++cnt;
  }
  if (flg1) {
    if (2 <= pa.size()) {
      if (pa[pa.size() - 2].second < num) {
        pa[pa.size() - 2].second = num;
      }
      for (int i = 0; i < pa.size() - 1; i++) {
        kabu = money / pa[i].first;
        money -= pa[i].first * kabu;
        money += pa[i].second * kabu;
        kabu = 0;
      }
    }
  } else {
    for (int i = 0; i < pa.size(); i++) {
      kabu = money / pa[i].first;
      money -= pa[i].first * kabu;
      money += pa[i].second * kabu;
      kabu = 0;
    }
  }
  cout << money << endl;
}
