#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define ll long long
#define FILE_READ_IN freopen("input.txt","r",stdin);
#define FILE_READ_OUT freopen("output.txt","w",stdout);
#define Fast ios_base::sync_with_stdio(false);cin.tie();cout.tie();
#define deb(x) cout<<#x<<" "<<x<<endl;
#define all(v) v.begin(),v.end()
#define endl '\n'
using namespace __gnu_pbds;
using namespace std;

template <typename T>
using ordered_set =
    tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

void judge() {
#ifndef ONLINE_JUDGE
	FILE_READ_IN
	FILE_READ_OUT
#endif
}

int main() {
	Fast;
	int t = 1;
	judge();
	// cin >> t;
	while (t--) {
		int n;
		cin >> n;
		int a[n + 1];
		for (int i = 1; i <= n; i++)cin >> a[i];
		int dp[n + 1] = {};
		dp[1] = 1000;
		// cout << a[1] << " " << dp[1] << endl;
		for (int i = 2; i <= n; i++) {
			for (int j = i - 1; j > 0; j--) {
				dp[i] = max(dp[i], (dp[j] / a[j]) * a[i] + dp[j] % a[j]);
				// cout << ((dp[j] / a[j]) * a[i]) + dp[j] % a[j] << endl;
				// cout << dp[j] << " " << a[j] << endl;
				// dp[i]=max(dp[i],dp[j])
				dp[i] = max(dp[j], dp[i]);
			}
			// cout << dp[i] << " ";
		}
		cout << dp[n] << endl;
	}
}
