#include <bits/stdc++.h>
using namespace std;
long long mod = 1e9 + 7;
string char_to_str(char c) {
  string tem(1, c);
  return tem;
}
long long max(long long a, long long b) {
  if (a > b) {
    return a;
  }
  return b;
}
long long min(long long a, long long b) {
  if (a < b) {
    return a;
  }
  return b;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ;
  long long n;
  cin >> n;
  vector<pair<long long, long long> > v;
  long long a[n];
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
    if (i == 0) {
      v.push_back({a[i], 0});
    } else {
      if (a[i] != v.back().first) {
        v.push_back({a[i], i});
      }
    }
  }
  if (v.size() <= 1) {
    cout << 1000;
    return 0;
  }
  vector<long long> min_inds;
  vector<long long> max_inds;
  if (v[0].first < v[1].first) {
    min_inds.push_back(0);
  } else {
    max_inds.push_back(0);
  }
  for (int i = 1; i < n - 1; ++i) {
    if ((v[i].first < v[i - 1].first) && (v[i].first < v[i + 1].first)) {
      min_inds.push_back(v[i].second);
    } else if ((v[i].first > v[i - 1].first) && (v[i].first > v[i + 1].first)) {
      max_inds.push_back(v[i].second);
    }
  }
  if (v[n - 1].first < v[n - 2].first) {
    min_inds.push_back(v[v.size() - 1].second);
  } else {
    max_inds.push_back(v[v.size() - 1].second);
  }
  long long ans = 1000;
  for (int i = 0; i < min_inds.size(); ++i) {
    long long bought_stocks = ans / a[min_inds[i]];
    long long rem_money = ans % a[min_inds[i]];
    auto it = lower_bound(max_inds.begin(), max_inds.end(), min_inds[i]);
    if (it != max_inds.end()) {
      long long sold_money = bought_stocks * a[*it];
      ans = sold_money + rem_money;
    }
  }
  cout << ans;
  return 0;
}
