#include<bits/stdc++.h>
#define ll long long
#define pb push_back
#define mp make_pair
#define PI 3.1415926535897932384626433832795
#define MOD 1000000007
using namespace std;
ll power(ll a,ll n)
{
          ll result=1;
          while(n>0)
          {
               if(n&1)
                    result=result*a;
               a=a*a;
               n=n>>1;
          }
          return result;
}
ll lcm(ll a,ll b)
{
          return ((a*b)/__gcd(a,b));
}
bool ispow2(ll n)
{
          return (ceil(log2(n))==floor(log2(n)));
}
bool isprime(ll n)
{
          if(n==1)
               return false;
          else if(n==2)
               return true;
          else
          {
               for(ll i=2;i*i<=n;++i)
               {
                    if(n%i==0)
                         return false;
               }
               return true;
          }
}

ll ncr(ll n,ll r)
{
    if(r > n - r)
          r = n - r;
    ll ans = 1;
    ll i;

    for(i = 1; i <= r; i++)
     {
        ans *= n - r + i;
        ans /= i;
    }

    return ans;
}
int main()
{
          ios_base::sync_with_stdio(0);
          cin.tie(0);

          int t=1;
          //cin>>t;
          while(t--)
          {
                         int n;
                         cin>>n;
                         int a[n];
                         int ind=0,low=INT_MAX;
                         for(int i=0;i<n;++i)
                         {
                              cin>>a[i];
                                   if(a[i]<low)
                                   {
                                        low = min(low,a[i]);
                                        ind = i;
                                   }

                         }
                         if(ind==n-1)
                              cout<<1000;
                         else
                         {
                              if(n==2)
                              {
                                   int stock = 1000/a[0];
                                   int amt=1000;
                                   amt = amt - stock*a[0];
                                   amt = amt + stock*a[1];
                                   cout<<amt;
                              }
                              else
                              {
                                   int stock=0,price=0,amt=1000,bought=0;
                                   for(int i=0;i<n-1;++i)
                                   {
                                        if(i==0)
                                        {
                                             stock = 1000/a[i];
                                             amt = amt - a[i]*stock;
                                             price = a[i];
                                        }
                                        else if(a[i]>price && stock>0)
                                        {
                                             amt = amt + stock*a[i];
                                             stock=0;
                                             bought=a[i];
                                             //cout<<bought<<"\n";
                                        }
                                        //cout<<stock<<" "<<amt<<"\n";
                                        if(stock==0 && a[i]<bought)
                                        {
                                             //cout<<amt<<"\n";
                                             //cout<<"here";
                                             //cout<<a[i]<<"\n";
                                             stock = amt/a[i];
                                             //cout<<stock<<"\n";
                                             amt = amt - a[i]*stock;
                                             //cout<<amt<<"\n";
                                             price = a[i];
                                        }
                                        //cout<<stock<<" "<<amt<<" "<<bought<<"\n";
                                        //cout<<"\n-----------\n";
                                   }
                                   cout<<amt+stock*a[n-1];
                              }
                         }
          }

          return 0;
}
