#include <bits/stdc++.h>
using namespace std;
int main() {
int n, price;
cin >> n;
int max_profit = 0, coins = 1000;
int shares = 0;
for (int i = 0; i < n; i++) {
cin >> price;
if (i % 2 == 0) { // buying shares
shares = coins / price;
coins -= shares * price;
} else { // selling shares
int profit = coins + shares * price;
max_profit = max(max_profit, profit);
coins = profit;
}
}
cout << max_profit - 1000 << endl;
return 0;
}