#include <bits/stdc++.h>
using namespace std;

#define ll long long
#define deb(x) cerr << #x << ":" << x << "\n"
#define all(x) x.begin(),x.end()
#define sz(x) x.size()

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>

void solve()
{
	int n;
	cin>>n;
	vector<int> v(n);
	for(auto &x:v)cin>>x;
	vector<int> d;
	int j=0;
	while(j<n && v[j]>v[j+1])j++;
	for(int i=j;i<n;i++){
		if(i==j || i==n-1 || v[i]>v[i+1]){
			d.emplace_back(v[i]);
			if(i+1<n && i)d.emplace_back(v[i+1]);
		}
	}
	ll yen=1000,cur=0;
	ll ans=1000;
	// for(auto x:d)cerr<<x<<" ";
	for(int i=0;i<sz(d);i++){
		if(i%2==0){
			cur=yen/d[i];
			yen-=cur*d[i];
		}else{
			yen+=d[i]*cur;
			ans=max(ans,yen);
			cur=0;
		}
	}
	cout<<ans<<"\n";
}

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    int t = 1;
    // cin >> t;
    while (t--)
    {
        solve();
    }
    return 0;
}