#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int,int>;

int main() {

  ll N;
  ll money = 1000;
  ll stock;x
  ll ans = -1;
  cin >> N;

  vector<ll> A(N);

  for (ll i = 0; i < N;++i)
    cin >> A[i];

  A.erase(std::unique(A.begin(), A.end()), A.end());

  for (ll i = 0;i < (1<<A.size());++i){
    money = 1000;
    stock = 0;
    for (ll j = 0; j < A.size();++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;

}
