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

dp = [[0]*(200) for i in range(N)]#所持金jの時のi日目の最大株
kabu0 = 1000#株をひとつも持ってない状態での所持金最大

dp[0][1000%A[0]] = 1000//A[0]

for i in range(1,N):
    dp[i][kabu0%A[i]]=kabu0//A[i]
    for j in range(0,200,1):
        kabu0 = max(kabu0,A[i]*dp[i-1][j]+j)
        dp[i][j]=dp[i-1][j]
    

print(kabu0)
