#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
int main()
{
	int t;
	t=1;
	while(t--)
	{
		int n;
		cin>>n;
		ll arr[n];
		for(int i=0;i<n;i++)
		{
			cin>>arr[i];
		}
		ll cost=1000;
		ll s=0;
		for(int i=0;i<n-1;i++)
		{
			if(arr[i]<arr[i+1] && cost)
			{
				s=s+(cost/arr[i]);
				ll i1=cost/arr[i];
				cost=cost-(i1*arr[i]);
			}
			else if(s)
			{
				cost=cost+(s*arr[i]);
				s=0;
			}
		}
		if(s)
		{
			cost=cost+(s*arr[n-1]);
		}
		cout<<max(1000,cost)<<endl;
	}
}
