import sys

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

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

j = N

if A[j-2] < A[j-1]:
    pass
else:
    while(A[j-2] < A[j-1]):
        j -= 1

for i in range(j-1):
    
    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*A[j-1]
print(money)   