#include <bits/stdc++.h>
using ll = long long;
using namespace std;
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
const long long INFLL = 1LL << 60;
const int INF = 1 << 30;
const double PI = acos(-1);
int main() {
  int n;
  ll stock = 0LL;
  ll has = 0LL;
  ll yen = 1000LL;
  cin >> n;
  vector<long long> a(n);
  for (int i = 0, i_len = (int)(n); i < i_len; i++) {
    cin >> a[i];
  }
  pair<ll, ll> data;
  vector<pair<ll, ll>> log;
  data = make_pair(INF, -INF);
  for (int i = 0, i_len = (int)(n); i < i_len; i++) {
    if (data.first > a[i]) {
      if (data.first != INF and data.second != -INF) {
        log.push_back(data);
      }
      data = make_pair(INF, -INF);
      data.first = a[i];
    } else if (data.second < a[i]) {
      data.second = a[i];
    } else {
      if (data.first != INF and data.second != -INF) {
        log.push_back(data);
      }
      data = make_pair(INF, -INF);
    }
  }
  if (data.first != INF and data.second != -INF) {
    log.push_back(data);
  }
  for (auto itr = (log).begin(), itr_fin = (log).end(); itr != itr_fin; itr++) {
    yen += ((itr->second) - (itr->first)) * (yen / (itr->first));
  }
  cout << yen << endl;
}
