#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;

typedef long long ll;
struct node{
    ll x,y;
    node(ll x,ll y){
        this->x = x; this->y = y;
    }
    bool operator < (node tmp){
        return y<tmp.y;
    }
};
vector<node> v;

int main(void)
{
    int n; cin>>n;
    ll a[88];
    for(int i=1;i<=n;++i) cin>>a[i];
    for(int i=1;i<=n;++i){
        for(int j=i+1;j<=n;++j){
            if(a[i]<a[j]) {
                v.push_back(node(i,j));
            }
        }
    }
    sort(v.begin(),v.end());
    ll ans = 1000, cnt = 0, num = v.size(), last1 = 200, last2 = 0;
    for(int i=1;i<=n;++i){
        for(int j=0;j<num;++j){
            if(v[j].y==i){
                if(a[i]<=last2 || cnt==0) continue;
                ans += a[i]*cnt;
                cnt = 0;
                last1 = a[i];
            }
            // cout<<"i:"<<i<<" ans:"<<ans<<" cnt:"<<cnt<<" last"<<last<<'\n';
            if(v[j].x==i){
                if(a[i]>=last1 || ans==0) continue;
                cnt += ans/a[i];
                ans %= a[i];
                last2 = a[i];
            }
        }
        // cout<<ans<<'\n';
    }
    cout<<ans;
    return 0;
}