#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
int main()
{
    IOS;
    //ll t;cin>>t;while(t--)
    {
        ll a,b,c,d,i,j,k,l,m,n,sum=0,temp=0,f=0,cnt=0;
        cin>>n;
        int arr[n];
        for(i=0;i<n;i++)cin>>arr[i];
        int max_arr[n]={0};
        max_arr[n-1]=arr[n-1];
        for(i=n-2;i>=0;i--)
        {
            max_arr[i]=max(arr[i],max_arr[i+1]);
        }
        //for(i=0;i<n;i++)
            //cout<<max_arr[i]<<" ";
        //cout<<endl;
        int stocks=0,yen=1000,prevs=*max_element(arr,arr+n);
        for(i=0;i<n-1;i++)
        {
            if(arr[i]<arr[i+1] && max_arr[i+1]>=arr[i])
                stocks+=(yen/arr[i]),yen=yen-(arr[i]*(yen/arr[i]));
            else if(i>0 && arr[i]>=arr[i-1])
                yen+=arr[i]*stocks,stocks=0,prevs=arr[i];
            //cout<<"yo "<<i<<" "<<stocks<<" "<<yen<<endl;
        }

        cout<<yen+stocks*arr[n-1]<<endl;

    }
}
