#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < (n); i++)
using namespace std;
using ll = long long;

int mani() {
	cin.tie(0)->sync_with_stdio(false);

	ll n; cin >> n;
	vector<ll> a(n);
	REP(i, n) cin >> a[i];

	vector<ll> dp(n);
	dp[0] = 1000;
	for (int i = 1; i < n; i++) {
		dp[i] = dp[i - 1];
		REP(j, i) {
			ll v = dp[j] / a[j];
			ll w = dp[j] + (a[i] - a[j]) * v;
			dp[i] = max(dp[i], w);
		}
	}

	cout << dp[n - 1] << '\n';
	return 0;
}