
#include<bits/stdc++.h>
using namespace std;
#define rep(i, N) for(int i = 0; i< N; i++)


int main() {
    int n; cin >> n;
    vector<int> a(n);
    rep(i,n) cin >> a[i];
    ll posession = 1000;
    ll stock = 0;
    rep(i,n-1) {
        if(a[i] == a[i+1]) continue;
        else if(a[i] > a[i+1]) {
            if(stock) {
                posession += stock * a[i];
                stock = 0;
            }
        } else if(a[i] < a[i+1]) {
            int newStock = posession/a[i];
            stock += newStock;
            posession -= a[i] * newStock;
        }
    }
    if(stock) {
        posession += stock * a[n-1];
        stock = 0;
    }
    cout << posession << endl;
}