#include<bits/stdc++.h>
#define IOS ios::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define debug(...) fprintf(stderr, __VA_ARGS__), fflush(stderr)
#define time__(d) for ( auto blockTime = make_pair(chrono::high_resolution_clock::now(), true);blockTime.second;\
debug("%s: %lld ms\n", d, chrono::duration_cast<chrono::milliseconds>(chrono::high_resolution_clock::now() - blockTime.first).count()), blockTime.second = false)
#define li long long int
#define ld long double
#define eb push_back
#define pb pop_back
#define INF 1e18+10
#define MINF -1e18-10
#define rep(i,a,b) for(li i=a;i<b;i++)
#define size(a) a.size()
#define rev(a) reverse(a.begin(),a.end())
#define len(a) a.length()
#define f first
#define s second
#define sort(a) sort(a.begin(),a.end())
#define vli vector<li>
#define vvli vector<vli >
#define pli pair<li,li>
#define vpli vector<pli>
#define inp(t) li t;cin>>t; while(t--)
using namespace std;
const li mod = 1e9+7;
#define MAXN 1000005 

li power(li a, li b) { a%=mod; li ret=1;while(b) {if(b&1) ret*=a;a*=a;if(ret>=mod) ret%=mod;if(a>=mod) a%=mod;b>>=1;}return ret;}

bool isprime(li n)
{
  if (n == 1)
    return false;
  int i = 2;
  while (i*i <= n){
      if (n % i == 0)return false;
      i += 1;
  }
  return true;
}

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

void solve()
{
  li n;
  cin>>n;

  vli v(n);
  rep(i,0,n)
  cin>>v[i];

  li money = 1000,stocks = 0;
  vli mark(n+1,0);
  li mn = v[0];
  li mx = v[0];
  bool fall = (v[0]>v[1])?true:false;
  if(!fall)
    mark[0] = -1; // sell money
  rep(i,1,n)
  {
    if(v[i]<v[i-1])
    {
      if(!fall)
      mark[i-1] = 1;  //get money
      fall = true;
      mn = v[i-1]; //peak value
      mn = min(mn,v[i]);
    }
    else if(v[i]>v[i-1])
    {
      if(fall)
        mark[i-1] = -1; //sell money
      fall = false;
      mx = v[i-1]; //tourgh value
      mx = max(mx,v[i]);
    }
  }

  rep(i,0,n)
  {
    if(mark[i]==-1)
    {
      stocks+=(money/v[i]);
      money%=v[i];
    }
    else
    {
      money+=(stocks*v[i]);
      stocks = 0;
    }
  }

  cout<<money<<endl;
}

int main()
{
    IOS;
    #ifndef ONLINE_JUDGE
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
    #endif

    solve();
    return 0;
}