#include<bits/stdc++.h>
using namespace std;
const long long MOD = 1e9+7;
#define rep(i,n) for(int i=0;i<n;++i)
typedef long long int ll;
typedef unsigned long long ull;
template<class T> inline bool chmin(T& a, T b) {if (a > b) {a = b;return true;}return false;}
template<class T> inline bool chmax(T& a, T b) {if (a < b) {a = b;return true;}return false;}
typedef pair<ll,ll> P;

int main()
{
    int n;
    cin >> n;
    vector<int> a(n);
    map<int,int>mp;
    rep(i,n){
        cin>>a[i];
        mp[a[i]]++;
    }
    ll my=1000,kabu=0;
    rep(i,n){
        mp[a[i]]--;
        bool l=false,h=false;
        for(int k=i+1;k<n;k++){
            if(a[i]>a[k]){
                l=true;
                if(h)break;
                else{
                    my += a[i]*kabu;
                    kabu=0;
                    break;
                }
            }
            if(a[i]<a[k]){
                h=true;
            }
        }
        bool l=false,h=false;
        for(int k=i+1;k<n;k++){
            if(a[i]>a[k]){
                l=true;
            }
            if(a[i]<a[k]){
                h=true;
                if(l)break;
                else {
                    int p =my/a[i];
                    kabu += p;
                    my-=a[i]*p;
                    break;
                }
            }
        }

        if(i==n-2 && a[i]<a[i+1]){
            int p =my/a[i];
            kabu += p;
            my-=a[i]*p;
        }
    }
    my+=kabu*a[n-1];
    cout<<my<<endl;
    return 0;
}
