/*		Author : Kaustubh Gangwar
		||S||A||M||R||A||T||
*/
#include <bits/stdc++.h>
using namespace std;
#define modo 1000000007
#define ff first
#define ss second 
#define ld long double
#define pb push_back
#define gcd __gcd
#define vi vector<int>
#define vll vector<long long>
#define all(x) (x).begin(),(x).end()
#define f(i,a,b) for(int i=a;i<b;i++)
#define fe(i,a,b) for(int i=a;i<=b;i++)
#define nl '\n'
typedef long long  ll;
typedef pair<int,int> pii;

ll bpow(ll a, ll b) {
	a=a; ll res = 1;
    while(b){
        if (b & 1)
        res = res * a;
        a = a * a;
        b >>= 1;
    }
    return res;
}

int32_t main()
{	ios_base::sync_with_stdio(false);
	cin.tie(0),cout.tie(0);
	ll test=1;
	//cin>>test;
	while(test--)
	{
		int n;
		cin>>n;
		int a[n+1];
		fe(i,1,n)
		cin>>a[i];
		
		int dp[n+5]={0};
		dp[1]=1000;
		int ans=1000;
		int vis[n+5]={0};
		fe(i,2,n)
		{
			f(j,1,i)
			{
				if(a[j]<a[i] && vis[j]==0)
				{
					int c=(dp[j]/a[j]);
					int rem=dp[j]%a[j];
					c*=a[i];
					c+=rem;
					if(c>ans)
					{
					ans=c;
					vis[i]=1;
					dp[i]=ans;
					}
					else
					dp[i]=ans;
					
				}
			}
		}
		
		cout<<ans;
		
	}
return 0;
}
