#include <algorithm>
#include <iostream>
#include <stack>
#include <queue>
#include <cmath>
#include <string>
#include <iterator>
#include <map>
#include <set>
#include <iomanip>
#include <vector>
using namespace std;
using ll = long long;
using ld = long double;
using P = pair<ll, ll>;
using Graph = vector<vector<int>>;
int dx[] = {0, 1, 0, -1};
int dy[] = {1, 0, -1, 0};
#define rep(i, N) for(int i = 0; i < N; i++)
#define rep2(i, l, r) for (ll i = (ll)l; i < (ll)(r); i++)
#define INF 1000000000000000000
#define MAX 200001
#define MOD 1000000007

template <typename T > inline string toString(const T &a) {ostringstream oss; oss << a; return oss.str();};

int main(){
    ll N;
    cin >> N;
    vector<ll> A(N);
    rep(i, N) cin >> A[i];
    vector<pair<ll,ll>> dp1(N, {0,0});
    vector<pair<ll,ll>> dp2(N, {0,0});
    dp1[0] = {1000 / A[0], 1000 % A[0]};
    dp2[0] = {1000, 0};
    for(int i = 1; i < N; i++){
        if(dp1[i-1].first < dp2[i-1].first / A[i] + dp2[i-1].second){
            dp1[i].first = dp2[i-1].first / A[i] + dp2[i-1].second;
            dp1[i].second = dp2[i-1].first % A[i]; 
        }
        else if(dp1[i-1].first == dp2[i-1].first / A[i] + dp2[i-1].second){
            if(dp1[i-1].second < dp2[i-1].first % A[i]){
                dp1[i].first = dp1[i-1].first;
                dp1[i].second = dp2[i-1].first % A[i];
            }
            else dp1[i] = dp1[i-1];
        }
        else dp1[i] = dp1[i-1];
        if(dp2[i-1].first <= dp1[i-1].first * A[i] + dp2[i-1].second) dp2[i].first = dp1[i-1].first * A[i] + dp1[i-1].second;
        else dp2[i] = dp2[i-1];
    }
    ll ans = 1000;
    for(int i = 0; i < N; i++){
        ans = max(ans, dp2[i].first);
    }
    cout << ans << endl;
}
