#include <bits/stdc++.h>
using namespace std;
 
int main(){
    int n;
    cin >> n;
    int a[n] = {};
    for(int i = 0; i < n; i++){
        cin >> a[i];
    }
    int money = 1000;
    int kabu = 0;
    int backmax = 0;
    int tmp = n-1;
    for(int i = n-1; i >= 1; i--){
        if(a[i] > a[i-1]){
            backmax = a[i];
            tmp = i;
            break;
        }
    }
    int frontmin = 1000;
    int tmpa = 0;
    for(int i = 0; i < n; i++){
        if(a[i] < a[i+1]){
            frontmin = a[i];
            tmpa = i;
            break;
        }
    }

    //cout << tmp << endl;
    //cout << backmax << endl;
    //cout << money << endl;
    //cout << kabu << endl;

    for(int i = 0; i < tmp ; i++){
        if(a[i] < a[i+1]){
            kabu = money / a[i];
            money = money % a[i];
        }else if(a[i] > a[i+1]){
            money = money + kabu * a[i];
            kabu = 0;
        }
        //cout << money << " " << kabu << endl;
    }


    cout << max(money + kabu * backmax,1000) << endl;

    return 0;
}