#include <bits/stdc++.h>
#include <string>
#include <vector>
#define rep(i,n) for (int i = 0;i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int,int>;

int main(){
    int n;
    cin >> n;
    vector<int> v(n);
    rep(i,n) cin >> v[i];

    vector<ll> dp(n);

    rep(i,n){
        if(i == 0) {
            dp[i] = 1000;
            continue;
        }

        int temp = dp[i-1];
        rep(j,i){
            temp = max(temp,dp[j]%v[j]+(dp[j]/v[j])*v[i]);
        }
        dp[i]  = temp;
    }

    cout << dp[n-1] << endl;

    
}