#include <bits/stdc++.h>

using namespace std;

int dp[81][81][85000];

int main() {

    int n;
    cin >> n;

    vector<int> v(n);

    for (int &x: v)
        cin >> x;

    int val = 1000;
    int cur = 0;
    int i = 0;
    int ans = 0;
    while(i < n) {
        int id = i;
        int mn = v[i];

        for (int j = i; j < n; ++j) {
            if(v[j] > v[i]) {
                id = j;
                break;
            }
        }

        for (int j = i; j <= id; ++j) {
            if(v[j] < mn) {
                mn = v[j];
            }
        }

        int num = val / mn;
        cur += num;
        val -= num * mn;
        val += v[id] * cur;
        cur = 0;
        i = id + 1;
        ans = max(ans, val);
    }

    cout << ans << "\n";

    return 0;
}
