#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
//typedef __int128_t LL;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
#define F first
#define S second
#define pb push_back
mt19937 rnd;


int main() {
    ios_base::sync_with_stdio(0); cin.tie(0);
#ifdef LOCAL
    freopen("input.txt", "r", stdin);
#endif

    int n;
    cin >> n;
    int a[n + 2] = {};
    for (int i = 1; i <= n; i++) {
        cin >> a[i];
    }
    int x = 1000, y = 0;
    for (int i = 1; i <= n; i++) {
        if ((i == 1 && a[i] <= a[i + 1]) || (i > 1 && a[i - 1] > a[i] && a[i] <= a[i + 1])) {
            int z = x / a[i];
            x -= z * a[i];
            y += z;
        }
        else if ((i == n) || (i < n && a[i - 1] < a[i] && a[i] >= a[i + 1])) {
            int z = y;
            x += z * a[i];
            y -= z;
        }
    }
    cout << x << "\n";

#ifdef LOCAL
    cerr << "\nTime elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
#endif
    return 0;
}
