#include <sys/time.h>

#include <iostream>
#include <iomanip>
#include <algorithm>
#include <utility>
#include <cmath>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <deque>
#include <utility>
#include <cctype>


#include <boost/multiprecision/cpp_int.hpp>

using namespace std;

using ll = unsigned long long;
using P = pair<double, double>;

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define mkp(a, b) make_pair(a, b)
ll mod = 1000000007LL;

namespace mp = boost::multiprecision;
using BigInt = mp::cpp_int;


int main() {
	int n;

	cin >> n;
	vector<ll> as;
	int prev = -1;

	rep(i ,n) {
		int cur;
		cin >> cur;

		if (prev == cur) continue;

		as.push_back(cur);
		prev = cur;
	}
	vector<ll> bs;

	if (as[0] < as[1]) {
		bs.push_back(as[0]);
	}
	/*
	for (int a: as) {
		cout << a << endl;
	}
	*/

	for(int i = 1; i < as.size() - 1; i++) {
		if (as[i - 1] < as[i] && as[i] > as[i + 1]) {
			bs.push_back(as[i]);
		} else 
		if (as[i - 1] > as[i] && as[i] < as[i + 1]) {
			bs.push_back(as[i]);
		}
	}

	if (as[as.size() - 2] < as[as.size() - 1]) {
		bs.push_back(as[as.size() - 1]);
	} 
	/*
	cout << "-----" << endl;
	for (int b: bs) {
		cout << b << endl;
	}
	*/
	BigInt money = 1000;
	for(int i = 0; i < bs.size(); i += 2) {
		BigInt stock = money / bs[i];
		money -= (BigInt) bs[i] * (BigInt) stock;
		money += (BigInt) bs[i + 1] * (BigInt) stock;
	}
	cout << money << endl;

	return 0;
}
