#include <bits/stdc++.h>
using namespace std;
typedef long long  ll;
const int N=2e5+5;
const int MOD=1e9+7;
ll a[N];

int b[N];
char s[N];
char t[N];
ll f[N];
int used[15];
int cmp1(ll a,ll b)
{
    return b<a;
}

multiset<int> ss;
map<int,int>mp;
int main()
{
    int n;
    cin>>n;
    for(int i=1;i<=n;i++) cin>>a[i];
    if(a[2]>a[1])b[1]=2;
    for(int i=2;i<=n-1;i++){
        if(a[i-1]<=a[i]&&a[i+1]<a[i]) b[i]=1;
    }
    ll stock=0;
    ll money=1000;
    for(int i=2;i<=n-1;i++)
    {
        if(a[i-1]>=a[i]&&a[i+1]>a[i]) b[i]=2;
    }

    for(int i=1;i<=n-1;i++){
        if(b[i]==1){

            money=money+stock*a[i];
            stock=0;
        }
        else if(b[i]==2){
            stock=money/a[i];
            money=money-stock*a[i];
        }
    }
    money+=stock*a[n];
    ll ans=max(money,1000);
    cout<<ans<<endl;


}
