
// Problem : D - Road to Millionaire
// Contest : AtCoder - M-SOLUTIONS Programming Contest 2020
// URL : https://atcoder.jp/contests/m-solutions2020/tasks/m_solutions2020_d
// Memory Limit : 1024 MB
// Time Limit : 2000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)

#include<bits/stdc++.h>
using namespace std;
#define ll int
int main()
{
	ll i,j,k,m,n,t;
	cin>>n;
	ll ar[n];
	m=1000;
	ll s=0;
	for(i=0;i<n;i++)
	cin>>ar[i];
	ll b[n+1]={0};
	b[0]=0;
	for(i=1;i<n;i++)
	{
		if(ar[i]>=ar[i-1])
		b[i]=b[i-1]+1;
	}
	for(i=0;i<n;i++)
	{
		if(b[i]==0 and b[i+1]==1)
		{
			s=m/ar[i];
			m%=ar[i];
		}
		else if(b[i]>0 and b[i+1]==0)
		{
			m+=s*ar[i];
			s=0;
		}
	}
	cout<<m;
}