import math

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

    # dp=[1]*202020
    # for i in range(K):
    #     dp[K]*=A[i]

    List = [[0 for j in range(N)] for i in range(N)]

    for i in range(N):
        for j in range(i,N):
            List[i][j]=A[j]-A[i]

    buy=False
    Kabu=0
    Yen=1000
    for i in range(N):
        isUp=True
        UpCnt=0
        DownStart=0
        for j in range(i+1,N):
            if(A[j]>A[i]):
                UpCnt+=1
            else:
                if(UpCnt==0):
                    DownStart=j
                    isUp=False
                    break
        if(i+1==N):
            isUp=False
        if(isUp and i>DownStart-1):
            if(buy==False):
                buy=True
                Kabu+=Yen//A[i]
                Yen-=A[i]*(Yen//A[i])
            else:
                buy=False
                Yen+=A[i]*Kabu
                Kabu=0

        else:
            if(buy==True):
                buy=False
                Yen+=A[i]*Kabu
                Kabu=0




    print(Yen)

resolve()
