#include<bits/stdc++.h>
#define ll long long
using namespace std;

int main(){
    int n;
    lla,cash=1000,stocks=0;
    cin >> n;
    vector<ll> V;
    for (int i=0;i<n;i++) {
        cin >> a;
        V.push_back(a);
    }
    V.push_back(1);
    for (int i=0;i<n;i++) {
        if (V[i+1]>=V[i]) {
            ll x=cash/V[i];
            stocks+=x;
            cash-=x*V[i];
        }
        else {
            cash+=stocks*V[i];
            stocks=0;
        }
    }
    cout << cash << endl;
}
