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

void __print(int x) {cerr << x;};void __print(long x) {cerr << x;};void __print(long long x) {cerr << x;};void __print(unsigned x) {cerr << x;};void __print(unsigned long x) {cerr << x;};void __print(unsigned long long x) {cerr << x;};void __print(float x) {cerr << x;};void __print(double x) {cerr << x;};void __print(long double x) {cerr << x;};void __print(char x) {cerr << '\'' << x << '\'';};void __print(const char *x) {cerr << '\"' << x << '\"';};void __print(const string &x) {cerr << '\"' << x << '\"';};void __print(bool x) {cerr << (x ? "true" : "false");}

#define int             long long
#define setbits(x)      __builtin_popcountll(x)
#define zerobits(x)      __builtin_ctzll(x)
#define mod             1000000007
#define inf             1e18
#define endl             '\n'
#define pb              push_back
#define all(x)          x.begin(),x.end()
#define ff              first
#define ss              second
int powmod(int a,int b) {int res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
int string_to_int(string s){int ans = 0;int p=1;for(int i=s.size()-1;i>=0;i--){ans += (s[i]-'0')*p;p *= 10;}return ans;}

//DEBUGGING-LINES
template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr <<'}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i);cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define debug(x...)
#endif

void t_c_c()
{
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
/*#ifndef ONLINE_JUDGE
	freopen("inp.txt", "r", stdin);
	freopen("out.txt", "w", stdout);
#endif*/

	int n; cin >> n;
	int arr[n];
	int mx = INT_MIN;
	for(int i=0;i<n;i++){
		cin >> arr[i];
		mx = max(mx,arr[i]);
	}
	int balance = 1000;
	int stocks = 0;
	if(mx <= arr[0]){
		cout << balance << endl;
		return;
	}
	else{
		stocks += (balance/arr[0]);
		balance = (balance%arr[0]);
	}
	bool is_left_big[n] = {0};
	stack<int> s;
	s.push(arr[n-1]);
	for(int i=n-2;i>=0;i--){
		if(arr[i]>=s.top()){
			s.push(arr[i]);
		}
		else{
			is_left_big[i] = 1;
		}
	}
	
	bool is_left_small[n] = {0};
	stack<int> ss;
	ss.push(arr[n-1]);
	for(int i=n-2;i>=0;i--){
		if(arr[i]>=ss.top()){
			is_left_small[i] = 1;
		}
		else{
			ss.push(arr[i]);
		}
	}
	
	//for(int i=0;i<n;i++){
		//cout << is_left_big[i] << " ";
	//}
	//cout << endl;
	//for(int i=0;i<n;i++){
		//cout << is_left_small[i] << " ";
	//}
	//cout << endl;
	
	for(int i=1;i<n;i++){
		if(arr[i]>=arr[i-1]){
			balance += (stocks*arr[i]);
			stocks = 0;
			if(is_left_big[i] and is_left_small[i]){
				//continue;
				//stocks += (balance/arr[i]);
				//balance = (balance%arr[i]); 
				//balance += (stocks*arr[i]);
				//stocks = 0;
			}
			else if(is_left_big[i]){
				stocks += (balance/arr[i]);
				balance = (balance%arr[i]);
			}
		}
		else{
			stocks += (balance/arr[i]);
			balance = (balance%arr[i]);
		}
		//debug(stocks,balance);
	}
	cout << balance << endl;
}

int32_t main()
{
	t_c_c();
	return 0;
}
