#include <bits/stdc++.h>
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse4")
using namespace std;
inline long long in() {
  long long x;
  scanf("%lld", &x);
  return x;
}
int32_t main() {
  long long n = in();
  vector<long long> a;
  long long x = in();
  a.push_back(x);
  for (long long i = 1; i < n; i++) {
    x = in();
    if (x == a.back()) continue;
    a.push_back(x);
  }
  vector<long long> df;
  vector<pair<long long, long long>> costs;
  for (long long i = 0; i < n - 1; i++) {
    x = a[i + 1] - a[i];
    if (x < 0) continue;
    if (x > 0 and df.empty()) {
      df.push_back(x);
      costs.push_back({a[i], a[i + 1]});
    } else if (x > df.back()) {
      df.push_back(x);
      costs.push_back({a[i], a[i + 1]});
    }
  }
  long long cur = 1000;
  auto buysell = [&](long long buy, long long sell) {
    long long stocks = cur / buy;
    long long cost = stocks * buy;
    cur -= cost;
    long long profit = stocks * sell;
    cur += profit;
  };
  if (costs.size() == 0) {
    cout << "1000";
    return 0;
  }
  for (auto i : costs) {
    buysell(i.first, i.second);
  }
  cout << cur;
}
