#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];
		for (int i = 0; i < n; i++)cin >> a[i];
		int st = 1000 / a[0];
		int rem = 1000 % a[0];
		int cst = a[0];
		for (int i = 0; i < n - 1; i++) {
			if (a[i + 1] > a[i]) {
				if (cst < a[i + 1]) {
					cst = max(cst, a[i]);
					rem = rem + st * cst;
					st = 0;
					cst = 0;
				}
				st = st + rem / a[i];
				rem = rem % a[i];
				cst = a[i + 1];
			}
			else {
				rem += st * cst;
				st = 0;
				cst = 0;
			}
		}
		rem += st * cst;
		cout << rem << endl;
	}
}