import numpy as np
n = int(input())
a = list(map(int, input().split()))

max_stock = 1000000
dp = [[] for _ in range(n+1)]
dp[0] = [1000, 0]

for i in range(n):
    for k in dp[i]:
        dp[i+1].append(k) # do nothing
        dp[i+1].append([k[0] % a[i] , k[1] + k[0] // a[i]]) # buy stock
        dp[i+1].append([k[0] + k[1]*a[i]]) # sell stock
max_ = 0
for i in dp[n]:
    if i[0] > max_:
        max_ = i[0]
print(max_)