#include <bits/stdc++.h>
using namespace std;
#define PI 3.1415926535
const long long int MOD = 998244353;
#define pb push_back
#define mp make_pair
#define fill(a)  memset(a, 0, sizeof (a))
#define FAST ios_base::sync_with_stdio(false);cin.tie(NULL);
#define watch(x) cout << (#x) << " is " << (x) << endl;
const long long int MAXX = 2e5+5;

typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int,int> ii;
typedef pair<int,ii> iii;
typedef vector<ii> vii;
typedef vector<vii> vvii;
typedef vector< iii > viii;

ll lcm(ll a, ll b) {
   return a / __gcd(a, b) * b;
}
int XOR(int x, int y){
  return (x | y) & (~x | ~y);
}
bool cmp(const pair<int,int> &a,const pair<int,int> &b) {
    return (a.second < b.second);
}
// bool isl = binary_search(x.begin(), x.end(), 5);
// __builtin_popcount(x)  - Returns the number of set bits in x
const long long int N = 1e7;
int binsearch(int lo, int hi){
    while(lo<hi){
        int mid=(lo+hi)/2;
        if((mid))   // check(mid)
            hi=mid;
        else
            lo=mid+1;
    }
    return lo;
}
int power(int x,int y){
    int res=1;
    while(y>0){
      if(y&1) res=((res*x));

      y/=2;
      x=((x*x));
    }
    return res;
}
int a[100];
int main(){
    FAST  
    int n;
    cin>>n;
    for(int i=1;i<=n;i++){
        cin>>a[i];
    }
    int buy=1,j=0;
    int cur=1000,stocks=0;
    for(int i=1;i<=n;){
        j=i;
        if(buy){
            while(j<=n && a[j]>=a[j+1]){
                j++;
            }
            if(j>n) break;
            stocks+= (cur/a[j]);
            cur-= (cur/a[j])*a[j];
            i=j+1;
            buy=0;
        }
        else{
            while(j<=n && a[j]<=a[j+1]){
                j++;
            }
            if(j>n) break;
            cur+= (stocks)*a[j];
            stocks=0;
            i=j+1;
            buy=1;
        }
    }
    cout<<cur;
    return 0;
}
