#include<bits/stdc++.h> 
using namespace std;
typedef long long ll;
template<typename T1,typename T2> bool chmin(T1 &a,T2 b){if(a<=b)return 0; a=b; return 1;}
template<typename T1,typename T2> bool chmax(T1 &a,T2 b){if(a>=b)return 0; a=b; return 1;}
int dx[4]={0,1,-1,0};
int dy[4]={1,0,0,-1};


signed main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout << fixed << setprecision(20);

    ll n;
    cin>>n;

    ll a[n];
    for(int i=0;i<n;i++)cin>>a[i];
    array<ll,2> dp[n+1][2]={};
    dp[0][0] = {1000,0};
    ll ans = 0;
    for(int i=0;i<n;i++){
        // pass
        for(int j=0;j<2;j++)dp[i+1][j] = dp[i][j];

        for(int j=0;j<2;j++){
            // buy
            if(chmax(dp[i+1][0][1],dp[i][j][1]+(ll)(dp[i][j][0]/a[i]))){
                dp[i+1][0][0] = dp[i][j][0] % a[i];
            }
            // sell
            if(chmax(dp[i+1][1][0],dp[i][j][0]+a[i]*dp[i][j][1])){
                dp[i+1][1][1] = 0;
            }
        }
        chmax(ans,dp[i+1][0][0]);
        chmax(ans,dp[i+1][1][0]);
    }
    cout << ans << endl;
    
}