#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define PI 3.14159265358979323846
#define int long long
constexpr long long INF = numeric_limits<long long>::max() / 2;
constexpr int MOD = 1000000007;
using Graph = vector<vector<int>>;



signed main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);

    int N;
    cin>>N;
    int A[N];
    rep(i,N){
        cin>>A[i];
    }

    int dp[N+1][3]{};
    dp[0][0]=1000;
    rep(i,N){
        dp[i+1][0]=max(dp[i][0],dp[i][2]*A[i]+dp[i][1]);
        if(dp[i][0]/A[i]==dp[i][2]) {
            dp[i+1][1]=max(dp[i][0]%A[i],dp[i][1]);
            dp[i+1][2]=dp[i][2];
        }
        else if(dp[i][0]/A[i]>=dp[i][2]){
            dp[i+1][1]=dp[i][0]%A[i];
            dp[i+1][2]=dp[i][0]/A[i];
        }
    }

    cout << dp[N][0]<<endl;

    



}
