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

#hoge日めにhoge枚の株券持ち
dp = [[-10 for _ in range(2010)] for _ in range(n+1)]

dp[0][0] = 1000

#　i日目にj枚の株を持っているときに
for i in range(n):
    for j in range(2005):
        if dp[i][j] < 0:
            continue
        #print("i: %d, j: %d, dp: %d"%(i,j,dp[i][j]) )
        maxbuy = dp[i][j]//l[i]
        for k in range(maxbuy+1):
            dp[i+1][j+k] = max(dp[i+1][j+k], dp[i][j]-l[i]*k)
        for k in range(j+1):
            dp[i+1][j-k] = max(dp[i+1][j-k], dp[i][j]+l[i]*k)
print(dp[n][0])