#include<bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007;
#define fil(x) memset(x, 0, sizeof(x))
#define fillb(x) memset(x,false,sizeof(x))
#define fillm(x) memset(x, -1, sizeof(x))
#define mp make_pair
#define pll pair<int, int>
#define pf printf
#define sf scanf
#define all(x) x.begin(),x.end()
#define pb push_back
#define IOS ios::sync_with_stdio(false); cin.tie(0);
#define np std::string::npos
#define fo(i,n) for(int i=0;i<n;i++)
#define fo1(i,n) for(int i=1;i<n;i++)
#define fof(i,a,b) for(int i=a;i<=b;i++)
#define off(i,a,b) for(int i=a;i>=b;i--)
#define of(i,n) for(int i=n-1;i>=0;i--)
#define stl(i,x) for(auto i=x.begin(); i!=x.end();i++)
#define highest(x) numeric_limits<x>::max()
#define lowest(x) numeric_limits<x>::min()
#define Inf INFINITY
#define minv(v) *min_element(v.begin(),v.end())
#define maxv(v) *max_element(v.begin(),v.end())
#define cases(cs,t) for(int cs=1;cs<=t;cs++)
#define PI acos(-1)
#define nl endl

typedef unsigned long long lll;
typedef long long ll;
int knigtx8[] = {2, 2, -2, -2, 1, 1, -1, -1}; ///knight move in chess
int knigty8[] = {1, -1, 1, -1, 2, -2, 2, -2}; ///knight move in chess
int dx8[] = {0, 0, 1, 1, 1, -1, -1, -1}; ///for 8 directions
int dy8[] = {1,-1, 1, -1, 0, 0, -1, 1}; ///for 8 directions
int dx4[] = {0, 0, 1, -1}; ///for 4 directions
int dy4[] = {1, -1, 0, 0}; ///for 4 directions
const int maxx=100005;

//this fuction sorts vector pair according to first element in descending order.
bool sortinrev(const pair<int,int> &a,const pair<int,int> &b)
{
    return a.first>b.first;
}
ll pw(ll a, ll b)
{
    ll ans = 1;
    for(ll i = 1; i <= b; ++i)
        ans = (ans * a);
    return ans;
}
template<typename T>inline T Bigmod(T base, T power, T MOD){
    T ret=1;
    while(power)
    {
        if(power & 1)ret=(ret*base)%MOD;
        base=(base*base)%MOD;
        power>>=1;
    }
    return ret;
}

int main()
{
    IOS;
    int n;cin>>n;
    int a[n];
    vector<int>v;
    vector<pair<int,int>>vp;
    fil(cnt);
    fo(i,n){
        cin>>a[i];
    }
    vp.pb({a[n-1],0});
    int c=0;
    for(int i=n-2;i>=0;i--)
    {
        if(a[i]<a[i+1]){
            c++;
            vp.pb({a[i],c});
        }
        else{
            c=0;
            vp.pb({a[i],c});
        }
    }
    reverse(all(vp));
    //fo(i,vp.size())cout<<vp[i].first<<" "<<vp[i].second<<endl;

    int have=1000,stock=0;
    int k = vp.size();
    for(int i=0;i<k;)
    {
        if(vp[i].second>0){
            stock = have/vp[i].first;
            have = have%vp[i].first;
            //cout<<"stock = "<<stock<<endl;
            i+=vp[i].second;
            have += stock*vp[i].first;
            //cout<<"have = "<<have<<endl;
        }
        else{
            i++;
            continue;
        }
    }
    cout<<have<<endl;
    return 0;
}
//8
//110 108 100 102 103 104 100 110
///Alhamdulillah
