N= int(input())
A = list(map(int,input().split()))
A.insert(0,A[0])
A.append(A[-1])
 
money = 1000
previous_tendency = "none"
current_tendency = "none"
count = 0


for n in range(1,len(A)-1):
    if A[n] < A[n+1]:
        current_tendency = "up"
    elif A[n] > A[n+1]:
        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]),previous_tendency, current_tendency)
        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)
    if current_tendency != "none":
        previous_tendency = current_tendency
print(money)