#include <iostream>
#include <iomanip>
#include <vector>
#include <utility>
#include <map>
#include <algorithm>
#include <queue>
#include <cmath>
#include <numeric>
#include <set>

using namespace std;
struct aaa{aaa(){cin.tie(nullptr); ios::sync_with_stdio(false); cout<<fixed<<setprecision(20);};}aaa;
template <class T>ostream &operator<<(ostream &o,const vector<T>&v){o<<"{";for(int i=0;i<(int)v.size();i++)o<<(i>0?", ":"")<<v[i];o<<"}";return o;}
#define debug(v) {cerr<<"\033[1;36m[debug]\033[m "<<#v<<" : "<<v<<endl;}

using int64 = long long;

int main() {
    int n;
    cin >> n;
    vector a(n,0);
    for (int i=0; i<n; i++) cin >> a[i];

    int y = 0;
    int x = 1000;
    for (int i=0; i<n; i++) {
        bool f = false;
        for (int j=i+1; j<n; j++) {
            if (a[i] > a[j]) break;
            if (a[i] < a[j]) {
                f = true;
                break;
            }
        }
        if (f) {
            y += x / a[i];
            x = x % a[i];
            continue;
        }

        for (int j=i+1; j<n; j++) {
            if (a[i] < a[j]) continue;
            if (a[i] > a[j]) {
                bool f2 = false;
                for (int k=j+1; k<n; k++) {
                    if (a[j] < a[k]) {
                        f2 = true;
                        break;
                    }
                }
                if (f2) {
                    x += y * a[i];
                    y = 0;
                    break;
                }
            }
        }
    }
    x += y*a.back();
//    debug(y);
//    debug(x);

    cout << x << endl;
}