#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll MOD = 1e9 + 7;
const ll LINF = LLONG_MAX;
const int INF = INT_MAX;
const double PI = acos(-1);
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;
}
int main() {
  ll n;
  cin >> n;
  vector<ll> a(n + 2, 0);
  a[0] = 10000;
  for (int i = (0); i < (int)(n); i++) cin >> a[i + 1];
  ll m = 1000;
  ll kabu = 0;
  for (int i = (1); i < (int)(n + 1); i++) {
    if (a[i - 1] >= a[i] and a[i] <= a[i + 1]) {
      ll buy_kabu = m / a[i];
      kabu += buy_kabu;
      m -= buy_kabu * a[i];
    } else if (a[i - 1] <= a[i] and a[i] >= a[i + 1]) {
      ll sell_money = kabu * a[i];
      kabu = 0;
      m += sell_money;
    }
    cout << "kabu"
         << ": " << kabu << endl;
    cout << "m"
         << ": " << m << endl;
  }
  cout << m << endl;
}
