#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
int main() {
  ll N;
  ll money = 1000;
  ll stock;
  ll ans = -1;
  cin >> N;
  vector<ll> A(N);
  for (ll i = 0; i < N; ++i) cin >> A[i];
  N = A.size();
  for (ll i = 0; i < (1 << N); ++i) {
    money = 1000;
    stock = 0;
    for (ll j = 0; j < N; ++j) {
      if ((i >> j) & 1) {
        if (A[j] < money) {
          stock += money / A[j];
          money = money % A[j];
        }
      } else {
        money += stock * A[j];
        stock = 0;
      }
    }
    ans = std::max(ans, money);
  }
  cout << ans << endl;
  return 0;
}
