#pragma GCC optimize("O3,unroll-loops")
#pragma GCC target("mmx,sse,sse2")
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace std;
using namespace __gnu_pbds;

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

template<class T>
using ordered_multiset = tree <T, null_type ,  less_equal<T> ,  rb_tree_tag ,  tree_order_statistics_node_update>;

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;

using vi = vector<int>;
using ii = pair<int, int>;
using vii = vector<ii>;
using vvi = vector<vi>;
using vvii = vector<vii>;
const int maxn = 81;
int main() {
	ios_base :: sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	int n, a[maxn];
	ll d = 1000, s = 0;
	cin >> n;
	for(int i = 1; i <= n; ++i) 
		cin >> a[i];
	for(int i = 1; i <= n; ++i) {
		int j = -1, y = 201;
		for(int k = i + 1; k <= n; ++k) {
			y = min(y, a[k]);
			if(a[k] > a[i]) {
				j = k;
				break;
			}
		}
		if(j != -1) {
			s += d / min(a[i], y);
			d = d % min(a[i], y) + s * a[j];
			s = 0;
			i = j - 1;
		}
	}	
	cout << d << '\n';
	return 0;
}