#include <bits/stdc++.h>
template <class T>
bool chmax(T& a, const T& b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
bool chmin(T& a, const T& b) {
  if (b < a) {
    a = b;
    return 1;
  }
  return 0;
}
using ll = long long;
using ull = unsigned long long;
using namespace std;
int main() {
  ll n;
  cin >> n;
  vector<ll> a(n), b(n);
  for (int i = 0; i < (n); i++) cin >> a[i], b[i] = a[i];
  sort(b.begin(), b.end());
  ll ans = 0;
  for (int i = 0; i < (n); i++) {
    ll k = b[i];
    ll kane = 1000, kabu = 0;
    for (int j = 0; j < (n); j++) {
      if (a[j] <= k) {
        kabu += kane / a[j];
        kane %= a[j];
      } else {
        kane += kabu * a[j];
        kabu = 0;
      }
    }
    kane += kabu * a[n - 1];
    if (ans < kane) ans = kane;
  }
  cout << ans << endl;
}
