N = int(input())
A = list(map(int,input().split()))
money = 1000
cab = 0
lowprice = A[0]
value = []
check = True
for i in range(1,N):
    if(lowprice>A[i]):
        lowprice = A[i]
        check= True
    elif(lowprice<A[i] and check == True):
        high_price = A[i]
        cab=money//lowprice
        money-=(lowprice*cab)
        money+=(high_price*cab)
        cab = 0
        check = False
        lowprice = high_price
print(money)