#include <algorithm>
#include <bitset>
#include <cstring>
#include <deque>
#include <functional>
#include <iostream>
#include <iterator>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#include <unordered_map>
#include <unordered_set>

using namespace std;

#define ll long long
#define pb push_back
#define debug1(x) cerr << #x << " = " << x << '\n';
#define debug2(x, y) cerr << #x << " = " << x << "   " << #y << " = " << y << "\n";
#define _ ios_base::sync_with_stdio(0);cin.tie(NULL);

void solve() {
    int n;
    cin >> n;
    int a[n+2] = {};
    a[0] = 201;
    a[n+1] = 99;
    for(int i = 1; i<=n; i++) {
        cin >> a[i];
    }
    int buy[n+1] = {};
    int sell[n+1] = {};
    for(int i = 1; i<=n ; i++) {
        if(a[i] == a[i-1] && a[i] == a[i+1]) continue;
        if(a[i] <= a[i-1] && a[i] <= a[i+1]) buy[i] = 1;
        if(a[i] >= a[i-1] && a[i] >= a[i+1]) sell[i] = 1;
    }
    int cash = 1000;
    int stock = 0;
    for(int i = 1; i<=n; i++) {
        if(buy[i] == 1) {
            int num = cash/a[i];
            stock += num;
            cash -= (num * a[i]);
        }
        if(sell[i] == 1) {
            cash += (a[i] * stock);
            stock = 0;
        }
    }
    cout << cash << '\n';
}

int main() {_
    int t = 1;
    //cin >> t;
    for(int i = 1; i<=t; i++) {
        solve();
    }
    return 0;
}
