#include<iostream>
#include<cstdlib>
#include <cmath>
#include<algorithm>
#include<vector>
#include<string>
#include<unordered_map>
#include <bits/stdc++.h>
using namespace std;

#define INF 10000000
int main()
{ 
    int N;
    cin >> N;
    
    int a[N];
    for(int i=0; i<N; i++){
        cin >> a[i];
    }
    
    long long money[N];
    for(int n=0; n<N; n++){
        money[n] = - INF;
    }
    money[0] = 1000;
    for(int n=1; n<N; n++){
        money[n] = money[n-1];
        for(int i=0; i<n; i++){
            lon long stock = money[i] / a[i];
            long long im = money[i] + (a[n]-a[i]) * stock;
            money[n] = max(money[n], im);
        }
    }
    
    cout << money[N-1] << endl;        
        
}
