#include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update
#include <ext/pb_ds/assoc_container.hpp> // Common file

using namespace __gnu_pbds;
using namespace std;

typedef long long  ll;
typedef long double  dbl;

//template <class T>
//using OSet= tree<T,null_type,greater<T>,rb_tree_tag,tree_order_statistics_node_update>;

#define endl "\n"
#define ee cout<<endl;
#define X first
#define Y second
#define maxx(a,b) a=max(a,b)
#define minn(a,b) a=min(a,b)
#define pb(x) push_back(x)

const int N=1e5+10,C=200,O=127,OO=0x7F7F7F7F;
const dbl EPS=-1e7;


int arr[100];
int main(){
    ios_base::sync_with_stdio(0);
    cin.tie(NULL),cout.tie(NULL);

    int n;
    cin>>n;
    int mn=300,pos=0;
    for(int i=0;i<n;++i){
        cin>>arr[i];
    }
    for(int i=n-1;i;--i){
        if(arr[i]>=arr[i-1]){
            if(arr[i-1]<=mn) mn=arr[i-1],pos=i-1;
        }
    }
    int num=0,mx=0;
    for(int i=pos+1;i<n;++i){
        maxx(mx,arr[i]);
    }

    if(mn==300) cout<<1000;
    else  cout<<1000/mn*mx;

}
