#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+1);
    int max = 0;
    rep(i,n) {
        cin >> v[i];
        if(v[i]>max) max = v[i];
    }
    v[n] = 0;

    int m = 1000;
    int st = 0;
    rep(i,n){

        if(v[i]== max){
                m = m + st*v[i];
                st = 0;
                break;
        }

        if(v[i] < v[i+1]){
            st = m / v[i];
            m %= v[i];
        }
        else if(v[i] > v[i+1]){
            m = m + st*v[i];
            st = 0;
        }

    
    cout << m << endl;
}