/*
  Hey , lakshay 05
  while( ! ( succeed == try)); // Follow this
  Don't compare yourself with anyone in the world,if you do so it means you are insulting yourself -> Bill Gates
  
*/

#include <bits/stdc++.h>
#define ll long long
#define RUNFAST  ios_base::sync_with_stdio(false);    cin.tie(NULL);
#define vec  vector<ll>
#define pi vector<pair<ll,ll>>
#define fi first
#define se second
#define pb push_back
#define print1(a) cout<<a;
#define print2(a,b) cout<<a<<" "<<b;
#define print3(a,b,c) cout<<a<<" "<<b<<" "<<c;
#define sort(v) sort(v.begin(), v.end())
#define rev(v) reverse(v.begin(), v.end())
#define issorted(v) is_sorted(v.begin(),v.end()
#define eb emplace_back
#define mp make_pair
//#define MOD 1000000007 // 998244353
using namespace std;
 
ll visited[210000]={0}; 
vector<ll>vg[210000];

// Print vector

void printv(vector<ll> v)
{
   for(auto x:v)
   cout<<x<<" ";
}

// Important Functions 
ll n;
 vec v,v1;
// DFS
void dfs(ll current)
{
    ll i,y;
    if(visited[current])
    return;
    visited[current]=1;
    for(i=0;i<n;i++)
    {
        if(v[i]==v[current] or v1[i]==v1[current])
        {
            dfs(i);
        }
    }
}
 
// BFS

void bfs(ll current)
{
    ll x,y,i;
    queue<ll>q;
    q.push(current);
    visited[current]=1;
    while(!q.empty())
    {
        x=q.front();
   //     cout<<x<<" ";
        q.pop();
        visited[x]=1;
        for(i=0;i<vg[x].size();i++)
        {
            y=vg[x][i];
            if(visited[y]==0)
            {
                visited[y]=1;
                q.push(y);
            }
        }
    }
}


// Prime Numbers
void checkprime(ll N) {
        ll count = 0;
        for( ll i = 1;i * i <=N;++i ) {
             if( N % i == 0) {
                 if( i * i == N )
                         count++;
                 else       // i < sqrt(N) and (N / i) > sqrt(N)
                         count += 2;
              }
        }
        if(count == 2)
        {
           // prime number   
        }
}        

// IO File
void IO()
{
    freopen("input.txt" , "r" , stdin);
    freopen("output.txt" , "w" , stdout);
}

// Multiplicative Inverse

ll power(ll x, unsigned ll y, unsigned ll m) 
{ 
    if (y == 0) 
        return 1; 
    ll p = power(x, y / 2, m) % m; 
    p = (p * p) % m; 
  
    return (y % 2 == 0) ? p : (x * p) % m; 
} 

ll modInverse(ll a,ll m) 
{ 
     return power(a, m - 2, m); 
     
} 
  
// LCM

ll lcm(ll a,ll b)
{  return (a*b)/__gcd(a,b);  
}


/* ---------------------------------------------------------------------------------------------------------*/ 
 
 void lakshay()
 {
          ll i,z=0,maxi=0,c,d,y=0,x,l=0,A[1000],B[1000],a,b,s=0,j,m,p,q,k,r;
          bool ok=true;
          cin>>n;
          k=1000;
          vec v(n),v1;
          for(i=0;i<n;i++)
          cin>>v[i];
          maxi=k;
          for(i=0;i<n;i++)
          {
              a=k/v[i];
              b=k%v[i];
              for(j=i+1;j<n;j++)
              {
//                  if(k>v[j])
  //                {
                      maxi=max(maxi,a*v[j]+b);
    //              }
              }
          }
         
    print1(maxi);
 }
 
int main() 
{  RUNFAST
    ll num;
num=1;
//cin>>num;
while(num--)
{ 
lakshay();
cout<<"\n";
}
return 0;
}