#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define REP(i, n) for(ll i=0; i<(ll)n; i++)
#define REPR(i, n) for(ll i=(ll)n-1; i>=0; i--)
#define FOR(i, m, n) for(ll i=(ll)m; i<(ll)n; i++)
#define FORR(i, m, n) for(ll i=(ll)m-1; i>=(ll)n; i--)
#define ALL(x) (x).begin(), (x).end()
#define ASC(v) sort(ALL(v));
#define DESC(v) sort(ALL(v), greater<int>());
#define UNIQ(a) sort(ALL(a));(a).resize(unique(ALL(a)) - a.begin());
#define PRINTD(x, d) cout << fixed << setprecision(d) << x << "\n";
#define DEBUG(x) cout<<#x<<": "<<x<<"\n"
const double PI = acos(-1);
ll lcm(ll a, ll b) { return a / __gcd(a, b) * b; }
bool isprime(int x){ int i; if(x<2)return 0; else if(x==2) return 1; if(x%2==0) return 0; for(i=3; i*i<=x; i+=2) if(x%i==0) return 0; return 1; }
int digsum(int n) { int r=0; while(n>0) { r+=n%10; n/=10; } return r; }
vector<string> split(string s, char p){vector<string>v;stringstream m(s);string b;while(getline(m,b,p))v.push_back(b);return v;}
template<class T> bool chmax(T &a, const T &b) { if (a<b) { a = b; return 1; } return 0; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a = b; return 1; } return 0; }
struct nya{ nya(){ cin.tie(0); ios::sync_with_stdio(false); } }nyan;

int main(){
    ll N; cin >> N;
    vector<ll> A(N);
    REP(n, N) cin >> A[n];
    vector<ll> B(N, 0);

    if (N==2) {
        if (A[0] > A[1]) {
            B[0] = 0;
            B[1] = 0;
        } else {
            B[0] = 2;
            B[1] = 1;
        }
    } else {
        bool isup = true;
        bool zuttotaira = false;
        FOR(n, 1, N) {
            if (A[n-1] != A[n]) {
                isup = A[n-1] >= A[n];
                break;
            }
            zuttotaira = true;
        }
        if (!zuttotaira) {
            // 1天井なら売る2底なら買う
            FOR(n, 1, N) {
                // 上昇？
                if (A[n-1] < A[n]) {
                    // 最初の上昇なら底
                    if (!isup) {
                        isup = true;
                        B[n-1] = 2;
                     }
                // 下降？
                } else if (A[n-1] > A[n]) {
                    // 最初の下降なら天井
                    if (isup) {
                        isup = false;
                        B[n-1] = 1;
                    }
                }
            }
        }
    }

    ll m = 1000;
    ll s = 0;
    REP(n, N) {
        if (B[n] == 1) {
            m += A[n]*s;
            s = 0;
        } else if(B[n] == 2) {
            s = m/A[n];
            m -= A[n]*s;
        }
    }
    if (s != 0) m += A[A.size()-1]*s;
    
    cout << m << "\n";
}
