import std.array;
import std.conv;
import std.string;
import std.algorithm;
import std.stdio;

void main() {
	auto n = readln.chomp.to!int;
	auto a = readln.chomp.split(' ').map!(to!long).array;

	auto dp = new long[][](n, n);
	dp[0][0] = 1000;

	foreach (i;0..n) {
		foreach (j;i + 1..n) {
			if (a[i] < a[j]) {
				dp[i + 1][j] = max(dp[i][j - 1], dp[i][j], dp[i][i] / a[i] * a[j] + dp[i][i] % a[i]);
			} else {
				dp[i + 1][j] = max(dp[i][j - 1], dp[i][j]);
			}
		}
	}

	writeln(dp[n - 1][n - 1]);
}
