N= int(input())
A = list(map(int,input().split()))
A.insert(0,A[0])
A.append(0)

money = 1000
min_price = A[0]
max_price =A[0]
previous_tendency = "none"
current_tendency = "none"
count = 0

for n in range(1,len(A)-1):
    if A[n] < A[n+1]:
        max_price = A[n]
        if previous_tendency != "up":
            min_price = A[n]   
        current_tendency = "up"
        
    elif A[n] > A[n+1]:
        min_price = A[n]
        if previous_tendency != "down":
            max_price = A[n]
        current_tendency = "down"
    else:
        current_tendency = "none"
        
    if previous_tendency != "down" and current_tendency != "up":
        #print(n,"chance",max(A[count:n+1]),min(A[count:n+1]))
        money += (money//min(A[count:n+1]))*(max(A[count:n+1])-min(A[count:n+1]))
        #print(money)
        count = n
    #print(A[n],max_price,min_price,previous_tendency,current_tendency)
    previous_tendency = current_tendency
print(money)