
N = int(input())
X = list(map(int, input().split()))

dp = [0] * (N + 1)
dp[0] = 1000
for i in range(N):
    for j in range(i):
        n = dp[j] // X[j]
        dp[i + 1] = max(dp[i + 1], dp[j] + (X[i] - X[j]) * n)

print(dp[-1])
