N=int(input())
A=list(map(int,input().split()))
 
for i in range(N-1,0,-1) :
    if A[i-1]>A[i] :
        if A[i]<A[i+1] :
            continue
        A.pop(i)
 
if len(A)==1 :
    print(1000)
    exit()

n=len(A)
money=1000
kabu=0
 
 
for i in range(n-1) : 
    if i==n-2 :
        if A[i-1]<=A[i] :
            continue
        elif A[i-1]>A[i] :
            kabu+=money//A[i]
            money-=A[i]*(money//A[i])
 
    if A[i]<A[i+1] and money>=A[i] : #株を買う
        kabu+=money//A[i]
        money-=A[i]*(money//A[i])
 
    elif A[i]>A[i+1] and kabu>0 :    #株を売る
        if A[i+1]>=A[i+2] :          #下がり続けていれば何もしない
            continue
        elif A[i+1]<A[i+2] :
            money+=kabu*A[i]
            kabu=0
 
else :
    money+=kabu*A[n-1]
    print(money)
    