import sys

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

money = 1000
stock = 0
status = "wait-for-buying"

last_sell = A.index(max(A))
for i in range(A.index(max(A))):
    if status == "wait-for-buying":
        if A[i] > A [i+1]:
            pass
        else:
            #buy
            stock = money//A[i]
            money = money%A[i]
            status = "wait-for-selling"
            
    else:
        if A[i] < A [i+1]:
            pass
        else:
            #sell
            money = stock*A[i]
            stock = 0
            status = "wait-for-buying"

money += stock*max(A)
print(money)   