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

dp = [[-1]*100000 for i in range(n+1)]

dp[0][0] = 1000

for i in range(n):
    for j in range(100000):
        if dp[i][j] >= 0:
            x = dp[i][j]
            c = x//a[i]
            dp[i+1][j] = max(dp[i+1][j],dp[i][j])
            dp[i+1][j+c] = max(dp[i+1][j+c],x-a[i]*c)
            dp[i+1][0] = max(dp[i+1][0],x+a[i]*j)
print(max(dp[-1]))