#include<bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < (n); ++i)

using namespace std;
using ll = long long;
using v1 = vector<int>;
using vl = vector<long long>;
using v2 = vector<vector<int>>;
using v3 = vector<vector<char>>;

int main(){
	int n;
	cin >> n;
	vl dp(n+1);
	rep(i, n){
		cin >> a[i+1];
	}
	dp[0] = 1000;
	rep(int k = 1; k <=n; k++){
		dp[i] = 0;
		for(int i = 1;i<k-1;i++){
			int m = 9999;
			for(int j = i+1; j<k; j++){
				m = min(m, a[j]);
			}
			dp[k] = max(dp[k], a[k]*dp[i]/m+dp[i]%m);
		}
	}
	ll ans = 0;
	rep(i, n+1) ans = max(ans, dp[i]);
	cout << ans << endl;
}
