#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
   ll n;
   cin>>n;
   vector<ll>v(n);
   for(int i=0;i<n;i++) cin>>v[i];
   ll i=0,yen=1000;
   while(i<(n-1))
   {
       while(i<n-1 && v[i+1]<=v[i]) i++;
       
       ll buy=i;
       
       while(i<n && v[i]>=v[i-1])
       {
           i++;
       }
       ll sell=i-1;
       
       yen=max(yen,(yen%v[buy]) + (yen/v[buy] )* v[sell])
   }
  cout<<yen<<"\n";
}