//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, srt, end) for (long long i = (srt); i < (long long)(end); i++)
#define VL vector<ll>
#define VS vector<string>
#define VB vector<bool>
#define VP vector<pair<ll,ll>>
#define VVL vector<vector<ll>>
#define VVP vector<vector<pair<ll,ll>>>
#define PL pair<ll,ll>
#define ALL(v) (v).begin(), (v).end()

int main(){
    ll N;
    cin >> N;
    ll ans=1000;
    ll flg=1;
    ll cnt=0;
    rep(i,0,N) cin >> a[i];
    rep(i,1,N){
        if(a[i] < a[i-1]) flg*=1;
        else flg*=0;
    }
    if(flg==1){cout<<ans<<endl;return 0;}
    
    for(int i=0;i<(1<<N);i++){
        for(int j=0; j<N; j++){
            if(i & (1<<j)){
                cnt = (ans/a[j]);
                ans -= ((ans/a[j])*a[j]);
            }
            else if(i & (0<<j)){
                ans += ((cnt)*a[j]);
            }
        }
        ans=max(ans,1000);
    }

    cout<<ans<<endl;
    return 0;
}