N = int(input())
A = list(map(int, input().split()))
buy = list(A[i] < A[i+1] for i in range(len(A)-1))
buy.append(False)
sell = list(A[i-1] < A[i] for i in range(1, len(A)))
sell.insert(0, False)

money = 1000
stock = 0

for i in range(N):
    if buy[i]:
        stock += money // A[i]
        money = money % A[i]
    if sell[i]:
        money += stock * A[i]
        stock = 0

print(money)