#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < (n); ++i) cin >> a[i];
  int id = 81;
  int amin = 205;
  for (int i = 0; i < (n); ++i) {
    if (amin > a[i]) {
      id = i;
      amin = a[i];
    }
  }
  vector<P> p;
  int kabu_m = 0;
  int id2 = 81;
  for (int i = id + 1; i < n; i++) {
    if (a[id] < a[i]) {
      p.push_back(make_pair(a[id], a[i]));
      kabu_m = a[i];
      id2 = i;
      break;
    }
  }
  if (kabu_m == 0) {
    cout << 1000 << endl;
    return 0;
  }
  int money = 1000;
  if (id2 == n - 1) {
    int k = money / p[0].first;
    money = money - k * p[0].first;
    money += k * p[0].second;
    cout << money << endl;
    return 0;
  }
  int cnt = 0;
  int kabu_r = kabu_m;
  int kabu_l = 205;
  for (int i = id2 + 1; i < n; i++) {
    if (kabu_r > a[i] && cnt == 0) {
      kabu_l = a[i];
      cnt++;
      continue;
    }
    if (kabu_l < a[i] && cnt == 1) {
      kabu_r = a[i];
      cnt++;
    }
    if (cnt == 2) {
      p.push_back(make_pair(kabu_l, kabu_r));
      cnt = 0;
    }
  }
  for (int i = 0; i < p.size(); i++) {
    int k = money / p[i].first;
    money = money - k * p[i].first;
    money += k * p[i].second;
  }
  cout << money << endl;
  return 0;
}
