#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, a, b) for (int i = a; i < (int)(b); i++)
#define all(v) v.begin(), v.end()
const int MOD = 1e9 + 7;
const int INF = 1e9;
//'A' = 65, 'Z' = 90, 'a' = 97, 'z' = 122

int main() {
    int n;
    cin >> n;
    int a[n + 1] = {};
    rep(i, 0, n) {
        cin >> a[i];
    }
    ll money = 1000;
    int cnt = 0;
    rep(i, 0, n) {
        if (a[i] < a[i + 1]) {
            ll x = money / a[i];
            cnt += x;
            money -= a[i] * x;
        }
        if (a[i] > a[i + 1]) {
            money += cnt * a[i];
            cnt = 0;
        }
    }
    cout << money << endl;
    return 0;
}
