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

dp = [[-1, -1] for _ in range(N)]
dp[0] = [(1000, 0), (1000%A[0], 1000//A[0])]
for i in range(1, N):
    dp[i][0] = max(dp[i-1][0], (dp[i-1][0][0]+dp[i-1][0][1]*A[i], 0), (dp[i-1][1][0]+dp[i-1][1][1]*A[i], 0))
    dp[i][1] = max((dp[i-1][0][1]+dp[i-1][0][0]//A[i-1], dp[i-1][0][0]%A[i-1]), 
                   (dp[i-1][1][1]+dp[i-1][1][0]//A[i-1], dp[i-1][1][0]%A[i-1]))[::-1]
# print(dp)
print(max(dp[-1])[0])