N = int(input())
A = list(map(int, input().split()))
DP = [[0 for _1 in range(2)] for _ in range(N) ]

DP[0][0] = 1000
DP[0][1] = 1000 % A[0]
max_stock = 1000//A[0]

for j in range(1, N):
    today = A[j]

    DP[j][0] = max(max(DP[0:j][0]),DP[j-1][0], DP[j-1][1] + max_stock*today)
    DP[j][1] =  max(DP[j-1][1], DP[j-1][0] - (DP[j-1][0]//today)*today)
    max_stock = max(DP[j-1][0]//today, max_stock)




print(DP[N-1][0])