#include <bits/stdc++.h>
#define repl(i, l, r) for (ll i = l; i < r; i++)
#define rep(i, n) repl(i, 0, n)
using namespace std;
using ll = long long;
using ld = long double;
using P = pair<int, int>;

int main()
{
    ll n;
    cin >> n;
    vector<ll> a(n);
    rep(i, n) cin >> a[i];
    bool buy = false;
    ll money = 1000;
    ll kabu = 0;
    repl(i, 1, n) {
        if(a[i] > a[i - 1]) {
            buy = true;
            kabu += money / a[i - 1];
            money %= a[i - 1];
        }
        else if(a[i] < a[i - 1]){
            buy = false;
            money += kabu * a[i - 1];
            kabu = 0;
        }
    }
    if(buy) money += kabu * a[n - 1];a
    cout << money << endl;
    return 0;
}
