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

int main(){
	cin.tie(0),ios::sync_with_stdio(false);
	int n; cin>>n;
	vector<int>a(n); for(auto&&i:a)cin>>i;
	vector<pair<int,int>>v;
	int b=0,s=0;
	for(int i=0;i<n;++i){
		if(a.at(i)<a.at(b))b=i;
		if(a.at(i)>a.at(s))s=i;
		if(b<s&&a.at(b)<a.at(s)){
			v.push_back({a.at(b),a.at(s)});
			b=i,s=i;
		}
	}
	int money=1000;
	for(auto&&i:v){
		int stock=money/i.first;
		money-=stock*i.first;
		money+=stock*i.second;
	}
	cout<<money<<"\n"s;
}
