n = int(input())
a = list(map(int, input().split()))

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

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